<div dir="ltr"><div>For the series:</div><div><br></div><div>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>></div><div><br></div><div>Marek<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 3, 2019 at 11:01 AM 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 for multiple launch cases, and unbind completed<br>
resources after launch.<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..a659fd2 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,10 @@ 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>
}<br>
<br>
static inline struct u_rect<br>
@@ -389,6 +393,13 @@ draw_layers(struct vl_compositor *c,<br>
<br>
cs_launch(c, layer->cs, &(drawn.area));<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, num_sampler_views, NULL);<br>
+ ctx->bind_compute_state(ctx, NULL);<br>
+ ctx->bind_sampler_states(c->pipe, PIPE_SHADER_COMPUTE, 0, num_sampler_views, NULL);<br>
+<br>
if (dirty) {<br>
struct u_rect drawn = calc_drawn_area(s, layer);<br>
dirty->x0 = MIN2(drawn.x0, dirty->x0);<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>