Commit a44b16d3 by Cody Northrop Committed by Angle LUCI CQ

Capture/Replay: Force validation on when capturing

Genshin Impact is using EGL_KHR_create_context_no_error to create a context that exposes GL_KHR_no_error. If it successfully creates the context, it sends down call sequences that check query results available immediately after genning query objects: glGenQueries(1, reinterpret_cast<GLuint *>(gReadBuffer)); UpdateQueryID(415, 0); glGetQueryObjectuiv(gQueryMap[415], GL_QUERY_RESULT_AVAILABLE, ...); This throws errors on every platform I have access to, with either native or ANGLE as the driver. The spec is ambiguous as to whether this should cause an error, but practically we can't allow this if we want error free playback of traces. To support this, we will force validation on in the context when FrameCapture is enabled. When the app submits invalid calls, they will be dropped by FrameCapture. Test: Genshin Impact MEC Bug: b/181794064 Change-Id: If882d27d74661cd95bc23687eff3056a0f64e3cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2921068 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent fe93fcdd
...@@ -3558,6 +3558,7 @@ void Context::initCaps() ...@@ -3558,6 +3558,7 @@ void Context::initCaps()
{ {
mState.mCaps = mImplementation->getNativeCaps(); mState.mCaps = mImplementation->getNativeCaps();
// TODO (http://anglebug.com/6010): mSupportedExtensions should not be modified here
mSupportedExtensions = generateSupportedExtensions(); mSupportedExtensions = generateSupportedExtensions();
if (!mDisplay->getFrontendFeatures().allowCompressedFormats.enabled) if (!mDisplay->getFrontendFeatures().allowCompressedFormats.enabled)
...@@ -3790,6 +3791,17 @@ void Context::initCaps() ...@@ -3790,6 +3791,17 @@ void Context::initCaps()
constexpr GLint maxDrawBuffers = 4; constexpr GLint maxDrawBuffers = 4;
INFO() << "Limiting draw buffer count to " << maxDrawBuffers; INFO() << "Limiting draw buffer count to " << maxDrawBuffers;
ANGLE_LIMIT_CAP(mState.mCaps.maxDrawBuffers, maxDrawBuffers); ANGLE_LIMIT_CAP(mState.mCaps.maxDrawBuffers, maxDrawBuffers);
// Unity based applications are sending down GL streams with undefined behavior.
// Disabling EGL_KHR_create_context_no_error (which enables a new EGL attrib) prevents that,
// but we don't have the infrastructure for disabling EGL extensions yet.
// Instead, disable GL_KHR_no_error (which disables exposing the GL extension), which
// prevents writing invalid calls to the capture.
INFO() << "Enabling validation to prevent invalid calls from being captured. This "
"effectively disables GL_KHR_no_error and enables GL_ANGLE_robust_client_memory.";
mSkipValidation = false;
mState.mExtensions.noError = mSkipValidation;
mState.mExtensions.robustClientMemory = !mSkipValidation;
} }
// Disable support for OES_get_program_binary // Disable support for OES_get_program_binary
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment