<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Nov 29, 2018 at 10:45 AM Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com">lionel.g.landwerlin@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Pipeline barriers inserted through vkCmdPipelineBarrier() should be<br>
taken into account when copying results.<br>
<br>
In the particular bug below, the results of the<br>
vkCmdCopyQueryPoolResults() command was being overwritten by the<br>
preceding vkCmdCopyBuffer() with a same destination buffer. This is<br>
because we copy the buffers using the 3D pipeline whereas we copy the<br>
query results using the command streamer. Those work in parallel<br>
unless synchronized.<br>
<br>
v2: Unconditionally flush the pipeline before copying the results<br>
(Jason)<br>
<br>
Signed-off-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a>><br>
Suggested-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>><br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=108894" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=108894</a><br>
Cc: <a href="mailto:mesa-stable@lists.freedesktop.org" target="_blank">mesa-stable@lists.freedesktop.org</a><br>
---<br>
src/intel/vulkan/genX_query.c | 9 ++++-----<br>
1 file changed, 4 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/genX_query.c b/src/intel/vulkan/genX_query.c<br>
index ce8757f2643..f1472c0d570 100644<br>
--- a/src/intel/vulkan/genX_query.c<br>
+++ b/src/intel/vulkan/genX_query.c<br>
@@ -729,11 +729,10 @@ void genX(CmdCopyQueryPoolResults)(<br>
ANV_FROM_HANDLE(anv_query_pool, pool, queryPool);<br>
ANV_FROM_HANDLE(anv_buffer, buffer, destBuffer);<br>
<br>
- if (flags & VK_QUERY_RESULT_WAIT_BIT) {<br>
- anv_batch_emit(&cmd_buffer->batch, GENX(PIPE_CONTROL), pc) {<br>
- pc.CommandStreamerStallEnable = true;<br>
- pc.StallAtPixelScoreboard = true;<br>
- }<br>
+ if (flags & VK_QUERY_RESULT_WAIT_BIT ||<br></blockquote><div><br></div><div>That bare & should have some parens. With that,</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ (cmd_buffer->state.pending_pipe_bits & ANV_PIPE_FLUSH_BITS)) {<br>
+ cmd_buffer->state.pending_pipe_bits |= ANV_PIPE_CS_STALL_BIT;<br>
+ genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer);<br>
}<br>
<br>
struct anv_address dest_addr = anv_address_add(buffer->address, destOffset);<br>
-- <br>
2.20.0.rc1<br>
<br>
</blockquote></div></div>