|
@@ -0,0 +1,45 @@
|
|
|
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
+From: Jamie Madill <[email protected]>
|
|
|
+Date: Mon, 29 Aug 2022 16:25:46 -0400
|
|
|
+Subject: Vulkan: Ensure we sync the draw FB before beingQuery.
|
|
|
+
|
|
|
+Bug: chromium:1354271
|
|
|
+(cherry picked from commit 4ebdac790c76b65abf5703bcef9482c638076195)
|
|
|
+Change-Id: I7b715a9c28badfe58a0ae1a478d2b4e8bbd23c47
|
|
|
+Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3956939
|
|
|
+Reviewed-by: Shahbaz Youssefi <[email protected]>
|
|
|
+
|
|
|
+diff --git a/src/libANGLE/State.h b/src/libANGLE/State.h
|
|
|
+index f8c1d9daaf31b5edb98edf3ca0a5c1983d6039cb..79403b13a94447c07bf0bfa6f9e6567e43346505 100644
|
|
|
+--- a/src/libANGLE/State.h
|
|
|
++++ b/src/libANGLE/State.h
|
|
|
+@@ -600,6 +600,11 @@ class State : angle::NonCopyable
|
|
|
+
|
|
|
+ bool isRobustResourceInitEnabled() const { return mRobustResourceInit; }
|
|
|
+
|
|
|
++ bool isDrawFramebufferBindingDirty() const
|
|
|
++ {
|
|
|
++ return mDirtyBits.test(DIRTY_BIT_DRAW_FRAMEBUFFER_BINDING);
|
|
|
++ }
|
|
|
++
|
|
|
+ // Sets the dirty bit for the program executable.
|
|
|
+ angle::Result onProgramExecutableChange(const Context *context, Program *program);
|
|
|
+ // Sets the dirty bit for the program pipeline executable.
|
|
|
+diff --git a/src/libANGLE/renderer/vulkan/QueryVk.cpp b/src/libANGLE/renderer/vulkan/QueryVk.cpp
|
|
|
+index 921adfc6e02984cb9b0ded70065df16f9241e4e7..f806326113d0804862481ac5508f07eab4d5ebe1 100644
|
|
|
+--- a/src/libANGLE/renderer/vulkan/QueryVk.cpp
|
|
|
++++ b/src/libANGLE/renderer/vulkan/QueryVk.cpp
|
|
|
+@@ -302,6 +302,13 @@ angle::Result QueryVk::begin(const gl::Context *context)
|
|
|
+ {
|
|
|
+ ContextVk *contextVk = vk::GetImpl(context);
|
|
|
+
|
|
|
++ // Ensure that we start with the right RenderPass when we begin a new query.
|
|
|
++ if (contextVk->getState().isDrawFramebufferBindingDirty())
|
|
|
++ {
|
|
|
++ ANGLE_TRY(contextVk->flushCommandsAndEndRenderPass(
|
|
|
++ RenderPassClosureReason::FramebufferBindingChange));
|
|
|
++ }
|
|
|
++
|
|
|
+ mCachedResultValid = false;
|
|
|
+
|
|
|
+ // Transform feedback query is handled by a CPU-calculated value when emulated.
|