[Mesa-dev] [RFC PATCH] mesa: Add MESA_SHADER_CAPTURE_PATH for writing .shader_test files.

Kenneth Graunke kenneth at whitecape.org
Mon Jan 18 14:59:15 PST 2016


On Tuesday, January 19, 2016 9:40:25 AM PST Timothy Arceri wrote:
> On Mon, 2016-01-18 at 07:05 -0800, Kenneth Graunke wrote:
> > @@ -1047,6 +1061,32 @@ link_program(struct gl_context *ctx, GLuint
> > program)
> >  
> >     _mesa_glsl_link_shader(ctx, shProg);
> >  
> > +   /* Capture .shader_test files. */
> > +   const char *capture_path = _mesa_get_shader_capture_path();
> > +   if (shProg->Name != 0 && capture_path != NULL) {
> > +      FILE *file;
> > +      char filename[PATH_MAX];
> > +
> > +      _mesa_snprintf(filename, sizeof(filename),
> > "%s/%u.shader_test",
> > +                     capture_path, shProg->Name);
> > +
> > +      file = fopen(filename, "w");
> > +      if (file) {
> > +         fprintf(file, "[require]\nGLSL >= %u.%02u\n",
> > +                 shProg->Version / 100, shProg->Version % 100);
> > +         if (shProg->SeparateShader)
> > +            fprintf(file, "GL_ARB_separate_shader_objects\n");
> 
> This just adds the GL_ARB_separate_shader_objects requirement it
> doesn't enable SSO in shader_runner, is that what you want?
> 
> Note that if you do enable it then each stage will be a separate
> program which is not necessarily what the application is doing although
> it will be much closer than not enabling it at all. 

Yeah...I wrote this code before you added "SSO ENABLED" to
shader_runner.  I originally had patches to shader-db's run.c that
made it use glCreateProgram when the [require] block specified
GL_ARB_separate_shader_objects, but I never merged it because I'm
pretty sure it was buggy.

I think specifying "SSO ENABLED" here (or maybe both?) and making
run.c handle that is the right thing to do.  I'll look into that.

--Ken
-------------- 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: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20160118/e3866c51/attachment.sig>


More information about the mesa-dev mailing list