[Mesa-dev] [PATCH 1/3] gallium: add PIPE_CAP_SHAREABLE_SHADERS

Marek Olšák maraeo at gmail.com
Mon Oct 19 16:07:01 PDT 2015


On Mon, Oct 19, 2015 at 11:52 PM, Rob Clark <robdclark at gmail.com> wrote:
> On Sat, Oct 10, 2015 at 9:09 PM, Marek Olšák <maraeo at gmail.com> wrote:
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> I'll let drivers figure out how to do it.
>> ---
>>  src/gallium/docs/source/screen.rst               | 2 ++
>>  src/gallium/drivers/freedreno/freedreno_screen.c | 1 +
>>  src/gallium/drivers/i915/i915_screen.c           | 1 +
>>  src/gallium/drivers/ilo/ilo_screen.c             | 1 +
>>  src/gallium/drivers/llvmpipe/lp_screen.c         | 1 +
>>  src/gallium/drivers/nouveau/nv30/nv30_screen.c   | 1 +
>>  src/gallium/drivers/nouveau/nv50/nv50_screen.c   | 1 +
>>  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c   | 1 +
>>  src/gallium/drivers/r300/r300_screen.c           | 1 +
>>  src/gallium/drivers/r600/r600_pipe.c             | 1 +
>>  src/gallium/drivers/radeonsi/si_pipe.c           | 1 +
>>  src/gallium/drivers/softpipe/sp_screen.c         | 1 +
>>  src/gallium/drivers/svga/svga_screen.c           | 1 +
>>  src/gallium/drivers/vc4/vc4_screen.c             | 1 +
>>  src/gallium/include/pipe/p_defines.h             | 1 +
>>  15 files changed, 16 insertions(+)
>>
>> diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
>> index e08844b..72f7596 100644
>> --- a/src/gallium/docs/source/screen.rst
>> +++ b/src/gallium/docs/source/screen.rst
>> @@ -276,6 +276,8 @@ The integer capabilities:
>>    GL4 hardware will likely need to emulate it with a shader variant, or by
>>    selecting the interpolation weights with a conditional assignment
>>    in the shader.
>> +* ``PIPE_CAP_SHAREABLE_SHADERS``: Whether shader CSOs can be used by any
>> +  pipe_context.
>
> An extra sentence along the lines that drivers supporting this cap can
> save pipe->screen ptr but not pipe ptr in the CSO might not hurt..
>
> other than that nitpick, lgtm..

I don't understand why drivers would want to put either of them into
the CSO. All calls manipulating the CSO take pipe_context, so you
always have some pipe_context and pipe_screen if you need them. The
correct answer - don't put any of them into the CSO - applied before
and still applies.

Marek


More information about the mesa-dev mailing list