Re: [Mesa-dev] [PATCH 3/3] gallium/auxiliary/vl: Add barrier/unbind after compute shader launch.

2019-04-03 Thread Ilia Mirkin
On Tue, Apr 2, 2019 at 2:22 PM Zhu, James  wrote:
>
> Add memory barrier sync and unbind resource after launch will enhance
> the robustness.

I can't tell from the comment -- is this working around driver bugs,
or is the state tracker using the API incorrectly and this fixes the
usage. If the latter, what was incorrect?

I don't think "enhance robustness" without a description of how is a
sufficient description.

  -ilia
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 3/3] gallium/auxiliary/vl: Add barrier/unbind after compute shader launch.

2019-04-03 Thread Marek Olšák
On Tue, Apr 2, 2019 at 2:22 PM Zhu, James  wrote:

> Add memory barrier sync and unbind resource after launch will enhance
> the robustness.
>
> Signed-off-by: James Zhu 
> ---
>  src/gallium/auxiliary/vl/vl_compositor_cs.c | 11 +++
>  1 file changed, 11 insertions(+)
>
> diff --git a/src/gallium/auxiliary/vl/vl_compositor_cs.c
> b/src/gallium/auxiliary/vl/vl_compositor_cs.c
> index c3afe61..f00cb65 100644
> --- a/src/gallium/auxiliary/vl/vl_compositor_cs.c
> +++ b/src/gallium/auxiliary/vl/vl_compositor_cs.c
> @@ -292,6 +292,17 @@ cs_launch(struct vl_compositor *c,
> info.grid[2] = 1;
>
> ctx->launch_grid(ctx, );
> +
> +   /* Make the result visible to all clients. */
> +   ctx->memory_barrier(ctx, PIPE_BARRIER_ALL);
> +
> +   /* Unbind. */
> +   ctx->set_shader_images(ctx, PIPE_SHADER_COMPUTE, 0, 1, NULL);
> +   ctx->set_constant_buffer(ctx, PIPE_SHADER_COMPUTE, 0, NULL);
> +   ctx->set_sampler_views(c->pipe, PIPE_SHADER_FRAGMENT, 0, 0, NULL);
>

count shouldn't be 0


> +   ctx->bind_compute_state(ctx, NULL);
> +   ctx->bind_sampler_states(c->pipe, PIPE_SHADER_COMPUTE, 0, 0, NULL);
>

same here

+   ctx->flush(ctx, NULL, 0);
>

the flush shouldn't be needed

Marek


>  }
>
>  static inline struct u_rect
> --
> 2.7.4
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 3/3] gallium/auxiliary/vl: Add barrier/unbind after compute shader launch.

2019-04-02 Thread Zhu, James
Add memory barrier sync and unbind resource after launch will enhance
the robustness.

Signed-off-by: James Zhu 
---
 src/gallium/auxiliary/vl/vl_compositor_cs.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/src/gallium/auxiliary/vl/vl_compositor_cs.c 
b/src/gallium/auxiliary/vl/vl_compositor_cs.c
index c3afe61..f00cb65 100644
--- a/src/gallium/auxiliary/vl/vl_compositor_cs.c
+++ b/src/gallium/auxiliary/vl/vl_compositor_cs.c
@@ -292,6 +292,17 @@ cs_launch(struct vl_compositor *c,
info.grid[2] = 1;
 
ctx->launch_grid(ctx, );
+
+   /* Make the result visible to all clients. */
+   ctx->memory_barrier(ctx, PIPE_BARRIER_ALL);
+
+   /* Unbind. */
+   ctx->set_shader_images(ctx, PIPE_SHADER_COMPUTE, 0, 1, NULL);
+   ctx->set_constant_buffer(ctx, PIPE_SHADER_COMPUTE, 0, NULL);
+   ctx->set_sampler_views(c->pipe, PIPE_SHADER_FRAGMENT, 0, 0, NULL);
+   ctx->bind_compute_state(ctx, NULL);
+   ctx->bind_sampler_states(c->pipe, PIPE_SHADER_COMPUTE, 0, 0, NULL);
+   ctx->flush(ctx, NULL, 0);
 }
 
 static inline struct u_rect
-- 
2.7.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev