<div dir="ltr"><div>If compute is used, graphics shaders don't need to be created.</div><div><br></div><div>Marek<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 8, 2019 at 9:02 AM James Zhu <<a href="mailto:jamesz@amd.com">jamesz@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"><br>
On 2019-02-08 6:33 a.m., Emil Velikov wrote:<br>
> On Thu, 7 Feb 2019 at 16:37, Zhu, James <<a href="mailto:James.Zhu@amd.com" target="_blank">James.Zhu@amd.com</a>> wrote:<br>
>> Add compute shader initilization, assign and cleanup in vl_compositor API.<br>
>><br>
>> Signed-off-by: James Zhu <<a href="mailto:James.Zhu@amd.com" target="_blank">James.Zhu@amd.com</a>><br>
>> Reviewed-by: Christian König <<a href="mailto:christian.koenig@amd.com" target="_blank">christian.koenig@amd.com</a>><br>
>> ---<br>
>> src/gallium/auxiliary/vl/vl_compositor.c | 31 ++++++++++++++++++++++++++++++-<br>
>> src/gallium/auxiliary/vl/vl_compositor.h | 3 +++<br>
>> 2 files changed, 33 insertions(+), 1 deletion(-)<br>
>><br>
>> diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c<br>
>> index 4509913..da4b02d 100644<br>
>> --- a/src/gallium/auxiliary/vl/vl_compositor.c<br>
>> +++ b/src/gallium/auxiliary/vl/vl_compositor.c<br>
>> @@ -28,12 +28,31 @@<br>
>> #include "util/u_sampler.h"<br>
>><br>
>> #include "vl_compositor_gfx.h"<br>
>> +#include "vl_compositor_cs.h"<br>
>><br>
>> static bool<br>
>> init_shaders(struct vl_compositor *c)<br>
>> {<br>
>> assert(c);<br>
>><br>
>> + c->cs_video_buffer = vl_compositor_cs_create_shader(c, compute_shader_video_buffer);<br>
>> + if (!c->cs_video_buffer) {<br>
>> + debug_printf("Unable to create video_buffer compute shader.\n");<br>
>> + return false;<br>
>> + }<br>
>> +<br>
>> + c->cs_weave_rgb = vl_compositor_cs_create_shader(c, compute_shader_weave);<br>
>> + if (!c->cs_weave_rgb) {<br>
>> + debug_printf("Unable to create weave_rgb compute shader.\n");<br>
>> + return false;<br>
>> + }<br>
>> +<br>
>> + c->cs_rgba = vl_compositor_cs_create_shader(c, compute_shader_rgba);<br>
>> + if (!c->cs_rgba) {<br>
>> + debug_printf("Unable to create RGB-to-RGB compute shader.\n");<br>
>> + return false;<br>
>> + }<br>
>> +<br>
> This constructs compute shaders even when we don't need them.<br>
> Can we have this behind a flag - say cs_compositor_render_enable or<br>
> something else?<br>
<br>
Yeah, I can add PIPE_CAP_COMPUTE check.<br>
<br>
James<br>
<br>
><br>
> -Emil<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><br>
</blockquote></div>