[Mesa-dev] [PATCH shader-db 1/2] run: Add separate shader objects support.

Kenneth Graunke kenneth at whitecape.org
Tue Jul 26 07:14:41 UTC 2016


On Tuesday, July 26, 2016 1:07:57 PM PDT Timothy Arceri wrote:
> On Mon, 2016-07-25 at 16:54 -0700, Kenneth Graunke wrote:
> > With this patch, if a .shader_test file contains
> > 
> >     [require]
> >     ...
> >     SSO ENABLED
> > 
> > then we'll set GL_PROGRAM_SEPARABLE to compile the shaders into
> > separate
> > shader objects.  This prevents the linker from removing unused inputs
> > and outputs.  Drivers may also choose to lay out interfaces of SSO
> > programs differently, resulting in different code.
> > 
> > v2:
> > - Actually initialize use_separate_shader_objects
> > - Fix memcmp length parameter (thanks to Matt)
> > 
> > v3:
> > - Search for "SSO ENABLED" instead of
> > "GL_ARB_separate_shader_objects",
> >   to match what Timothy did in shader_runner.
> > - Use GL_PROGRAM_SEPARABLE (suggested by Tapani).  This allows
> >   multi-stage SSO programs to optimize internal interfaces, while
> >   still making the end-stages separable.
> 
> When using SSO ENABLED in shader_runner each stage is linked as a
> separte program here you are creating multi-stage SSO programs. Unless
> you are combining the program with another SSO program enabling SSO
> doesn't seem very useful. Ideally we would capture and combine specific
> stages but that would get complicated which is why I just linked
> everything as separate programs in shader_runner.

Hmm, good point.  Given that we're using the same file format, I'd
like both run.c and shader_runner to have the same semantics.  I saw
that you were using GL_PROGRAM_SEPARABLE, but I didn't noticed that
you were creating separate programs for each.

I'm happy to respin this to use glCreateProgramv instead, which is
about 4 lines of code and should match the Piglit behavior.  How does
that sound?

I don't think the difference will matter much in practice - every
SSO case I've looked at has a single stage per program, anyway.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160726/1f5bd8ed/attachment-0001.sig>


More information about the mesa-dev mailing list