Clear draw attachments as a dirty object.
This allows us to skip 1/2 of the robust resource init check in
Context::setupDraw. The plan is to remove the other half in a follow-up
CL.
Most of the work of this CL was already handled. We just need to add
the right dirty object mask to the Context's draw dirty objects list.
We can mask out this check when robust resource is not enabled.
Bug: angleproject:2966
Change-Id: I97ec2497c95e5cdf52988e1ce85f7602206935f0
Reviewed-on: https://chromium-review.googlesource.com/c/1343140
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 150301f..d5ec259 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -1475,8 +1475,6 @@
case GL_MAX_DRAW_BUFFERS_EXT:
*params = mCaps.maxDrawBuffers;
break;
- // case GL_FRAMEBUFFER_BINDING: // now equivalent to
- // GL_DRAW_FRAMEBUFFER_BINDING_ANGLE
case GL_SUBPIXEL_BITS:
*params = 4;
break;
@@ -3472,6 +3470,12 @@
mThreadPool = angle::WorkerThreadPool::Create(mExtensions.parallelShaderCompile);
+ // Reinitialize some dirty bits that depend on extensions.
+ mDrawDirtyObjects.set(State::DIRTY_OBJECT_DRAW_ATTACHMENTS,
+ mGLState.isRobustResourceInitEnabled());
+ mBlitDirtyObjects.set(State::DIRTY_OBJECT_DRAW_ATTACHMENTS,
+ mGLState.isRobustResourceInitEnabled());
+
// Reinitialize state cache after extension changes.
mStateCache.initialize(this);
}
@@ -3518,7 +3522,7 @@
if (isRobustResourceInitEnabled())
{
ANGLE_TRY(mGLState.clearUnclearedActiveTextures(this));
- ANGLE_TRY(mGLState.getDrawFramebuffer()->ensureDrawAttachmentsInitialized(this));
+ ASSERT(!mGLState.getDrawFramebuffer()->hasResourceThatNeedsInit());
}
ANGLE_TRY(syncDirtyBits());
@@ -3964,7 +3968,7 @@
Framebuffer *framebuffer = mGLState.getDrawFramebuffer();
ASSERT(framebuffer);
framebuffer->setDrawBuffers(n, bufs);
- mGLState.setObjectDirty(GL_DRAW_FRAMEBUFFER);
+ mGLState.setDrawFramebufferDirty();
mStateCache.onDrawFramebufferChange(this);
}
@@ -7251,7 +7255,8 @@
case GL_NUM_SHADER_BINARY_FORMATS:
case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
case GL_ARRAY_BUFFER_BINDING:
- case GL_FRAMEBUFFER_BINDING:
+ case GL_FRAMEBUFFER_BINDING: // GL_FRAMEBUFFER_BINDING now equivalent to
+ // GL_DRAW_FRAMEBUFFER_BINDING_ANGLE
case GL_RENDERBUFFER_BINDING:
case GL_CURRENT_PROGRAM:
case GL_PACK_ALIGNMENT:
@@ -7553,7 +7558,7 @@
// Check for ES3.0+ parameter names which are also exposed as ES2 extensions
switch (pname)
{
- // case GL_DRAW_FRAMEBUFFER_BINDING_ANGLE // equivalent to FRAMEBUFFER_BINDING
+ // GL_DRAW_FRAMEBUFFER_BINDING_ANGLE equivalent to FRAMEBUFFER_BINDING
case GL_READ_FRAMEBUFFER_BINDING_ANGLE:
if ((getClientMajorVersion() < 3) && !getExtensions().framebufferBlit)
{
@@ -8104,7 +8109,7 @@
case kDrawFramebufferSubjectIndex:
if (message == angle::SubjectMessage::STORAGE_CHANGED)
{
- mGLState.setObjectDirty(GL_DRAW_FRAMEBUFFER);
+ mGLState.setDrawFramebufferDirty();
}
mStateCache.onDrawFramebufferChange(this);
break;