<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 2, 2019 at 2:22 PM Zhu, James <<a href="mailto:James.Zhu@amd.com">James.Zhu@amd.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Add memory barrier sync and unbind resource after launch will enhance<br>
the robustness.<br>
<br>
Signed-off-by: James Zhu <<a href="mailto:James.Zhu@amd.com" target="_blank">James.Zhu@amd.com</a>><br>
---<br>
 src/gallium/auxiliary/vl/vl_compositor_cs.c | 11 +++++++++++<br>
 1 file changed, 11 insertions(+)<br>
<br>
diff --git a/src/gallium/auxiliary/vl/vl_compositor_cs.c b/src/gallium/auxiliary/vl/vl_compositor_cs.c<br>
index c3afe61..f00cb65 100644<br>
--- a/src/gallium/auxiliary/vl/vl_compositor_cs.c<br>
+++ b/src/gallium/auxiliary/vl/vl_compositor_cs.c<br>
@@ -292,6 +292,17 @@ cs_launch(struct vl_compositor *c,<br>
    info.grid[2] = 1;<br>
<br>
    ctx->launch_grid(ctx, &info);<br>
+<br>
+   /* Make the result visible to all clients. */<br>
+   ctx->memory_barrier(ctx, PIPE_BARRIER_ALL);<br>
+<br>
+   /* Unbind. */<br>
+   ctx->set_shader_images(ctx, PIPE_SHADER_COMPUTE, 0, 1, NULL);<br>
+   ctx->set_constant_buffer(ctx, PIPE_SHADER_COMPUTE, 0, NULL);<br>
+   ctx->set_sampler_views(c->pipe, PIPE_SHADER_FRAGMENT, 0, 0, NULL);<br></blockquote><div><br></div><div>count shouldn't be 0<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+   ctx->bind_compute_state(ctx, NULL);<br>
+   ctx->bind_sampler_states(c->pipe, PIPE_SHADER_COMPUTE, 0, 0, NULL);<br></blockquote><div><br></div><div>same here</div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+   ctx->flush(ctx, NULL, 0);<br></blockquote><div><br></div><div>the flush shouldn't be needed</div><div><br></div><div>Marek<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
 }<br>
<br>
 static inline struct u_rect<br>
-- <br>
2.7.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></blockquote></div></div>