[Mesa-dev] [PATCH v3 5/6] gallium/auxiliary/vl: Add compute shader initilization, assign and cleanup
Emil Velikov
emil.l.velikov at gmail.com
Fri Feb 8 11:33:52 UTC 2019
On Thu, 7 Feb 2019 at 16:37, Zhu, James <James.Zhu at amd.com> wrote:
>
> Add compute shader initilization, assign and cleanup in vl_compositor API.
>
> Signed-off-by: James Zhu <James.Zhu at amd.com>
> Reviewed-by: Christian König <christian.koenig at amd.com>
> ---
> src/gallium/auxiliary/vl/vl_compositor.c | 31 ++++++++++++++++++++++++++++++-
> src/gallium/auxiliary/vl/vl_compositor.h | 3 +++
> 2 files changed, 33 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
> index 4509913..da4b02d 100644
> --- a/src/gallium/auxiliary/vl/vl_compositor.c
> +++ b/src/gallium/auxiliary/vl/vl_compositor.c
> @@ -28,12 +28,31 @@
> #include "util/u_sampler.h"
>
> #include "vl_compositor_gfx.h"
> +#include "vl_compositor_cs.h"
>
> static bool
> init_shaders(struct vl_compositor *c)
> {
> assert(c);
>
> + c->cs_video_buffer = vl_compositor_cs_create_shader(c, compute_shader_video_buffer);
> + if (!c->cs_video_buffer) {
> + debug_printf("Unable to create video_buffer compute shader.\n");
> + return false;
> + }
> +
> + c->cs_weave_rgb = vl_compositor_cs_create_shader(c, compute_shader_weave);
> + if (!c->cs_weave_rgb) {
> + debug_printf("Unable to create weave_rgb compute shader.\n");
> + return false;
> + }
> +
> + c->cs_rgba = vl_compositor_cs_create_shader(c, compute_shader_rgba);
> + if (!c->cs_rgba) {
> + debug_printf("Unable to create RGB-to-RGB compute shader.\n");
> + return false;
> + }
> +
This constructs compute shaders even when we don't need them.
Can we have this behind a flag - say cs_compositor_render_enable or
something else?
-Emil
More information about the mesa-dev
mailing list