Commit 1788355b by Charlie Lao Committed by Commit Bot

Vulkan: Add dirty bits instead of direct access FBO state

The CL crrev/c/2551541 causes intermittent Bot failure. I believe the problem is that from ContextVk::onMakeCurrent call stack, the object state may not in sync or even not completely specified. So instead of accessing fbo state object here to update mGraphicsPipelineDesc, we should insert dirty bit and let state validation code to handle it. Bug: b/175157604 Change-Id: I5f6b9fd901cc4187068f6161bd12836c8bbf8e87 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2580914 Commit-Queue: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: 's avatarIan Elliott <ianelliott@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent f9f569e2
...@@ -54,7 +54,7 @@ void *AlignedAlloc(size_t size, size_t alignment) ...@@ -54,7 +54,7 @@ void *AlignedAlloc(size_t size, size_t alignment)
void AlignedFree(void *ptr) void AlignedFree(void *ptr)
{ {
#if defined(_MSC_VER) #if defined(ANGLE_PLATFORM_WINDOWS)
_aligned_free(ptr); _aligned_free(ptr);
#else #else
free(ptr); free(ptr);
......
...@@ -2930,6 +2930,8 @@ angle::Result ContextVk::syncState(const gl::Context *context, ...@@ -2930,6 +2930,8 @@ angle::Result ContextVk::syncState(const gl::Context *context,
mDrawFramebuffer->setReadOnlyDepthFeedbackLoopMode(false); mDrawFramebuffer->setReadOnlyDepthFeedbackLoopMode(false);
updateFlipViewportDrawFramebuffer(glState); updateFlipViewportDrawFramebuffer(glState);
updateSurfaceRotationDrawFramebuffer(glState); updateSurfaceRotationDrawFramebuffer(glState);
SpecConstUsageBits usageBits = getCurrentProgramSpecConstUsageBits();
updateGraphicsPipelineDescWithSpecConstUsageBits(usageBits);
updateViewport(mDrawFramebuffer, glState.getViewport(), glState.getNearPlane(), updateViewport(mDrawFramebuffer, glState.getViewport(), glState.getNearPlane(),
glState.getFarPlane(), isViewportFlipEnabledForDrawFBO()); glState.getFarPlane(), isViewportFlipEnabledForDrawFBO());
updateColorMasks(glState.getBlendStateExt()); updateColorMasks(glState.getBlendStateExt());
...@@ -3088,7 +3090,17 @@ angle::Result ContextVk::onMakeCurrent(const gl::Context *context) ...@@ -3088,7 +3090,17 @@ angle::Result ContextVk::onMakeCurrent(const gl::Context *context)
updateFlipViewportReadFramebuffer(glState); updateFlipViewportReadFramebuffer(glState);
updateSurfaceRotationDrawFramebuffer(glState); updateSurfaceRotationDrawFramebuffer(glState);
updateSurfaceRotationReadFramebuffer(glState); updateSurfaceRotationReadFramebuffer(glState);
invalidateDriverUniforms();
if (getFeatures().forceDriverUniformOverSpecConst.enabled)
{
invalidateDriverUniforms();
}
else
{
// Force update mGraphicsPipelineDesc
mCurrentGraphicsPipeline = nullptr;
invalidateCurrentGraphicsPipeline();
}
const gl::ProgramExecutable *executable = mState.getProgramExecutable(); const gl::ProgramExecutable *executable = mState.getProgramExecutable();
if (executable && executable->hasTransformFeedbackOutput() && if (executable && executable->hasTransformFeedbackOutput() &&
...@@ -3199,9 +3211,6 @@ void ContextVk::updateSurfaceRotationDrawFramebuffer(const gl::State &glState) ...@@ -3199,9 +3211,6 @@ void ContextVk::updateSurfaceRotationDrawFramebuffer(const gl::State &glState)
gl::Framebuffer *drawFramebuffer = glState.getDrawFramebuffer(); gl::Framebuffer *drawFramebuffer = glState.getDrawFramebuffer();
mCurrentRotationDrawFramebuffer = mCurrentRotationDrawFramebuffer =
DetermineSurfaceRotation(drawFramebuffer, mCurrentWindowSurface); DetermineSurfaceRotation(drawFramebuffer, mCurrentWindowSurface);
SpecConstUsageBits usageBits = getCurrentProgramSpecConstUsageBits();
updateGraphicsPipelineDescWithSpecConstUsageBits(usageBits);
} }
void ContextVk::updateSurfaceRotationReadFramebuffer(const gl::State &glState) void ContextVk::updateSurfaceRotationReadFramebuffer(const gl::State &glState)
......
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