Mesa (main): dzn: Mark transition barriers as executed when we execute barriers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 1 10:02:52 UTC 2022


Module: Mesa
Branch: main
Commit: a577acf8f617e29a29c13b8a0ef1d9665544fa39
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a577acf8f617e29a29c13b8a0ef1d9665544fa39

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Thu Jun 30 05:06:01 2022 -0700

dzn: Mark transition barriers as executed when we execute barriers

It was previously done dzn_cmd_buffer_flush_transition_barriers(),
leaving the queue+flush case unhandled. Let's fix that by moving
this piece of code to dzn_cmd_buffer_exec_transition_barriers().

Fixes: 35356b1173e ("dzn: Cache and pack transition barriers")
Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17314>

---

 src/microsoft/vulkan/dzn_cmd_buffer.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/microsoft/vulkan/dzn_cmd_buffer.c b/src/microsoft/vulkan/dzn_cmd_buffer.c
index b49a3c7761b..a1bc1fc427f 100644
--- a/src/microsoft/vulkan/dzn_cmd_buffer.c
+++ b/src/microsoft/vulkan/dzn_cmd_buffer.c
@@ -53,6 +53,10 @@ dzn_cmd_buffer_exec_transition_barriers(struct dzn_cmd_buffer *cmdbuf,
    if (flush_count)
       ID3D12GraphicsCommandList1_ResourceBarrier(cmdbuf->cmdlist, flush_count,
                                                  &barriers[barrier_count - flush_count]);
+
+   /* Set Before = After so we don't execute the same barrier twice. */
+   for (uint32_t b = 0; b < barrier_count; b++)
+      barriers[b].Transition.StateBefore = barriers[b].Transition.StateAfter;
 }
 
 static void
@@ -69,10 +73,6 @@ dzn_cmd_buffer_flush_transition_barriers(struct dzn_cmd_buffer *cmdbuf,
       return;
 
    dzn_cmd_buffer_exec_transition_barriers(cmdbuf, &barriers[first_subres], subres_count);
-
-   /* Set Before = After so we don't execute the same barrier twice */
-   for (uint32_t b = first_subres; b < first_subres + subres_count; b++)
-      barriers[b].Transition.StateBefore = barriers[b].Transition.StateAfter;
 }
 
 enum dzn_queue_transition_flags {



More information about the mesa-commit mailing list