Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit dfd7600

Browse files
null77Commit Bot
authored andcommitted
Vulkan: Don't update pipeline when only textures change.
We could expand this functionality in the future to only update the pipeline when a signficiant bit of pipeline state changes. For now this is mostly a proof of concept. Significantly improves performance in the textures microbenchmark. Bug: angleproject:3117 Change-Id: I3957dd2f08d7d89694f94ddbe45eeeeb620bac0a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1650790 Reviewed-by: Tobin Ehlis <[email protected]> Reviewed-by: Shahbaz Youssefi <[email protected]> Reviewed-by: Jamie Madill <[email protected]> Commit-Queue: Jamie Madill <[email protected]>
1 parent 351e809 commit dfd7600

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/libANGLE/renderer/vulkan/ContextVk.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ ContextVk::ContextVk(const gl::State &state, gl::ErrorSet *errorSet, RendererVk
222222

223223
mDirtyBits = mNewCommandBufferDirtyBits;
224224
mActiveTextures.fill(nullptr);
225+
226+
mPipelineDirtyBitsMask.set();
227+
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_TEXTURE_BINDINGS);
225228
}
226229

227230
#undef INIT
@@ -1390,7 +1393,7 @@ angle::Result ContextVk::syncState(const gl::Context *context,
13901393
const gl::State::DirtyBits &dirtyBits,
13911394
const gl::State::DirtyBits &bitMask)
13921395
{
1393-
if (dirtyBits.any())
1396+
if ((dirtyBits & mPipelineDirtyBitsMask).any())
13941397
{
13951398
invalidateVertexAndIndexBuffers();
13961399
}

src/libANGLE/renderer/vulkan/ContextVk.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,8 @@ class ContextVk : public ContextImpl, public vk::Context, public vk::CommandBuff
590590

591591
// Generator for texure serials.
592592
SerialFactory mTextureSerialFactory;
593+
594+
gl::State::DirtyBits mPipelineDirtyBitsMask;
593595
};
594596
} // namespace rx
595597

0 commit comments

Comments
 (0)