Commit 6fead375 by Jamie Madill Committed by Commit Bot

Vulkan: No-op redundant FB state changes.

This uses a trick by comparing the prior to the updated FB description to filter out rendundant changes. Will allow the front-end syncState to sometimes noisily report state changes when there aren't any in the back-end. Ideally we wouldn't generate any updates when there aren't real changes. However because Manhattan often transitons between a few zero states it gets a bit difficult to determine in the front-end. Also adds a no-op for redundant samples changes in the front-end. Fixes a regression in the number of RenderPasses in Manhattan from work to support rendering feedback loops. Bug: angleproject:4490 Change-Id: Ibf83d584107a4561da7ad47a2d3fb543e63e31f1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2112935Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 31e36a63
...@@ -1455,6 +1455,9 @@ void State::invalidateTexture(TextureType type) ...@@ -1455,6 +1455,9 @@ void State::invalidateTexture(TextureType type)
void State::setSamplerBinding(const Context *context, GLuint textureUnit, Sampler *sampler) void State::setSamplerBinding(const Context *context, GLuint textureUnit, Sampler *sampler)
{ {
if (mSamplers[textureUnit].get() == sampler)
return;
mSamplers[textureUnit].set(context, sampler); mSamplers[textureUnit].set(context, sampler);
mDirtyBits.set(DIRTY_BIT_SAMPLER_BINDINGS); mDirtyBits.set(DIRTY_BIT_SAMPLER_BINDINGS);
// This is overly conservative as it assumes the sampler has never been bound. // This is overly conservative as it assumes the sampler has never been bound.
......
...@@ -1001,6 +1001,8 @@ angle::Result FramebufferVk::syncState(const gl::Context *context, ...@@ -1001,6 +1001,8 @@ angle::Result FramebufferVk::syncState(const gl::Context *context,
{ {
ContextVk *contextVk = vk::GetImpl(context); ContextVk *contextVk = vk::GetImpl(context);
vk::FramebufferDesc priorFramebufferDesc = mCurrentFramebufferDesc;
// For any updated attachments we'll update their Serials below // For any updated attachments we'll update their Serials below
ASSERT(dirtyBits.any()); ASSERT(dirtyBits.any());
for (size_t dirtyBit : dirtyBits) for (size_t dirtyBit : dirtyBits)
...@@ -1090,6 +1092,12 @@ angle::Result FramebufferVk::syncState(const gl::Context *context, ...@@ -1090,6 +1092,12 @@ angle::Result FramebufferVk::syncState(const gl::Context *context,
} }
} }
// No-op redundant changes to prevent closing the RenderPass.
if (mCurrentFramebufferDesc == priorFramebufferDesc)
{
return angle::Result::Continue;
}
// The FBO's new attachment may have changed the renderable area // The FBO's new attachment may have changed the renderable area
const gl::State &glState = context->getState(); const gl::State &glState = context->getState();
ANGLE_TRY(contextVk->updateScissor(glState)); ANGLE_TRY(contextVk->updateScissor(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