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,
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;
if (dirtyBits.none())
......@@ -1207,8 +1199,7 @@ angle::Result ContextVk::handleDirtyGraphicsPipelineDesc(DirtyBits::Iterator *di
// feedback counter buffer.
if (mRenderPassCommands->started() && mRenderPassCommands->isTransformFeedbackActiveUnpaused())
{
ANGLE_TRY(
flushCommandsAndEndRenderPassMidDirtyBitHandling(dirtyBitsIterator, dirtyBitMask));
ANGLE_TRY(flushDirtyGraphicsRenderPass(dirtyBitsIterator, dirtyBitMask));
dirtyBitsIterator->setLaterBit(DIRTY_BIT_TRANSFORM_FEEDBACK_RESUME);
}
......@@ -1222,11 +1213,13 @@ angle::Result ContextVk::handleDirtyGraphicsPipelineDesc(DirtyBits::Iterator *di
angle::Result ContextVk::handleDirtyGraphicsRenderPass(DirtyBits::Iterator *dirtyBitsIterator,
DirtyBits dirtyBitMask)
{
ASSERT(mRenderPassCommandBuffer == nullptr);
// Closing a render pass can affect the pipeline (by setting subpass to 0), and sets dirty bits.
// As such, it's expected that the render pass is closed before dirty bits are handled.
ASSERT(!mRenderPassCommands->started());
// 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.
if (mRenderPassCommands->started())
{
ANGLE_TRY(flushDirtyGraphicsRenderPass(dirtyBitsIterator,
dirtyBitMask & ~DirtyBits{DIRTY_BIT_RENDER_PASS}));
}
gl::Rectangle scissoredRenderArea = mDrawFramebuffer->getRotatedScissoredRenderArea(this);
bool renderPassDescChanged = false;
......@@ -4925,9 +4918,8 @@ angle::Result ContextVk::flushCommandsAndEndRenderPass()
return angle::Result::Continue;
}
angle::Result ContextVk::flushCommandsAndEndRenderPassMidDirtyBitHandling(
DirtyBits::Iterator *dirtyBitsIterator,
DirtyBits dirtyBitMask)
angle::Result ContextVk::flushDirtyGraphicsRenderPass(DirtyBits::Iterator *dirtyBitsIterator,
DirtyBits dirtyBitMask)
{
ASSERT(mRenderPassCommands->started());
......
......@@ -854,13 +854,12 @@ class ContextVk : public ContextImpl, public vk::Context, public MultisampleText
void dumpCommandStreamDiagnostics();
angle::Result flushOutsideRenderPassCommands();
// Flush commands and end render pass without setting any dirty bits.
// flushCommandsAndEndRenderPass() and flushCommandsAndEndRenderPassMidDirtyBitHandling() will
// set the dirty bits directly or through the iterator respectively. Outside those two
// functions, this shouldn't be called directly.
// flushCommandsAndEndRenderPass() and flushDirtyGraphicsRenderPass() will set the dirty bits
// directly or through the iterator respectively. Outside those two functions, this shouldn't
// be called directly.
angle::Result flushCommandsAndEndRenderPassImpl();
angle::Result flushCommandsAndEndRenderPassMidDirtyBitHandling(
DirtyBits::Iterator *dirtyBitsIterator,
DirtyBits dirtyBitMask);
angle::Result flushDirtyGraphicsRenderPass(DirtyBits::Iterator *dirtyBitsIterator,
DirtyBits dirtyBitMask);
void flushDescriptorSetUpdates();
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