Commit 3c28b2a0 by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Remove render pass check from setupDraw()

... and move it to handleDirtyGraphicsRenderPass. Bug: angleproject:5528 Change-Id: I416b2fedb1cd924d04fa739aecb65193fd845f6b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2686441 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent e8c0aa81
...@@ -821,14 +821,6 @@ angle::Result ContextVk::setupDraw(const gl::Context *context, ...@@ -821,14 +821,6 @@ angle::Result ContextVk::setupDraw(const gl::Context *context,
invalidateGraphicsDriverUniforms(); invalidateGraphicsDriverUniforms();
} }
// If the render pass needs to be recreated, close it before processing dirty bits. This
// operation may add many dirty bits.
ASSERT((mRenderPassCommandBuffer == nullptr) == mGraphicsDirtyBits.test(DIRTY_BIT_RENDER_PASS));
if (mRenderPassCommandBuffer == nullptr)
{
ANGLE_TRY(flushCommandsAndEndRenderPass());
}
DirtyBits dirtyBits = mGraphicsDirtyBits & dirtyBitMask; DirtyBits dirtyBits = mGraphicsDirtyBits & dirtyBitMask;
if (dirtyBits.none()) if (dirtyBits.none())
...@@ -1207,8 +1199,7 @@ angle::Result ContextVk::handleDirtyGraphicsPipelineDesc(DirtyBits::Iterator *di ...@@ -1207,8 +1199,7 @@ angle::Result ContextVk::handleDirtyGraphicsPipelineDesc(DirtyBits::Iterator *di
// feedback counter buffer. // feedback counter buffer.
if (mRenderPassCommands->started() && mRenderPassCommands->isTransformFeedbackActiveUnpaused()) if (mRenderPassCommands->started() && mRenderPassCommands->isTransformFeedbackActiveUnpaused())
{ {
ANGLE_TRY( ANGLE_TRY(flushDirtyGraphicsRenderPass(dirtyBitsIterator, dirtyBitMask));
flushCommandsAndEndRenderPassMidDirtyBitHandling(dirtyBitsIterator, dirtyBitMask));
dirtyBitsIterator->setLaterBit(DIRTY_BIT_TRANSFORM_FEEDBACK_RESUME); dirtyBitsIterator->setLaterBit(DIRTY_BIT_TRANSFORM_FEEDBACK_RESUME);
} }
...@@ -1222,11 +1213,13 @@ angle::Result ContextVk::handleDirtyGraphicsPipelineDesc(DirtyBits::Iterator *di ...@@ -1222,11 +1213,13 @@ angle::Result ContextVk::handleDirtyGraphicsPipelineDesc(DirtyBits::Iterator *di
angle::Result ContextVk::handleDirtyGraphicsRenderPass(DirtyBits::Iterator *dirtyBitsIterator, angle::Result ContextVk::handleDirtyGraphicsRenderPass(DirtyBits::Iterator *dirtyBitsIterator,
DirtyBits dirtyBitMask) DirtyBits dirtyBitMask)
{ {
ASSERT(mRenderPassCommandBuffer == nullptr); // If the render pass needs to be recreated, close it using the special mid-dirty-bit-handling
// function, so later dirty bits can be set.
// Closing a render pass can affect the pipeline (by setting subpass to 0), and sets dirty bits. if (mRenderPassCommands->started())
// As such, it's expected that the render pass is closed before dirty bits are handled. {
ASSERT(!mRenderPassCommands->started()); ANGLE_TRY(flushDirtyGraphicsRenderPass(dirtyBitsIterator,
dirtyBitMask & ~DirtyBits{DIRTY_BIT_RENDER_PASS}));
}
gl::Rectangle scissoredRenderArea = mDrawFramebuffer->getRotatedScissoredRenderArea(this); gl::Rectangle scissoredRenderArea = mDrawFramebuffer->getRotatedScissoredRenderArea(this);
bool renderPassDescChanged = false; bool renderPassDescChanged = false;
...@@ -4925,9 +4918,8 @@ angle::Result ContextVk::flushCommandsAndEndRenderPass() ...@@ -4925,9 +4918,8 @@ angle::Result ContextVk::flushCommandsAndEndRenderPass()
return angle::Result::Continue; return angle::Result::Continue;
} }
angle::Result ContextVk::flushCommandsAndEndRenderPassMidDirtyBitHandling( angle::Result ContextVk::flushDirtyGraphicsRenderPass(DirtyBits::Iterator *dirtyBitsIterator,
DirtyBits::Iterator *dirtyBitsIterator, DirtyBits dirtyBitMask)
DirtyBits dirtyBitMask)
{ {
ASSERT(mRenderPassCommands->started()); ASSERT(mRenderPassCommands->started());
......
...@@ -854,13 +854,12 @@ class ContextVk : public ContextImpl, public vk::Context, public MultisampleText ...@@ -854,13 +854,12 @@ class ContextVk : public ContextImpl, public vk::Context, public MultisampleText
void dumpCommandStreamDiagnostics(); void dumpCommandStreamDiagnostics();
angle::Result flushOutsideRenderPassCommands(); angle::Result flushOutsideRenderPassCommands();
// Flush commands and end render pass without setting any dirty bits. // Flush commands and end render pass without setting any dirty bits.
// flushCommandsAndEndRenderPass() and flushCommandsAndEndRenderPassMidDirtyBitHandling() will // flushCommandsAndEndRenderPass() and flushDirtyGraphicsRenderPass() will set the dirty bits
// set the dirty bits directly or through the iterator respectively. Outside those two // directly or through the iterator respectively. Outside those two functions, this shouldn't
// functions, this shouldn't be called directly. // be called directly.
angle::Result flushCommandsAndEndRenderPassImpl(); angle::Result flushCommandsAndEndRenderPassImpl();
angle::Result flushCommandsAndEndRenderPassMidDirtyBitHandling( angle::Result flushDirtyGraphicsRenderPass(DirtyBits::Iterator *dirtyBitsIterator,
DirtyBits::Iterator *dirtyBitsIterator, DirtyBits dirtyBitMask);
DirtyBits dirtyBitMask);
void flushDescriptorSetUpdates(); void flushDescriptorSetUpdates();
void onRenderPassFinished(); void onRenderPassFinished();
......
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