[Mesa-dev] [PATCH shader-db 2/2] run: Mark shaders with only one stage as separable.

Timothy Arceri timothy.arceri at collabora.com
Tue Jul 26 02:59:37 UTC 2016


On Mon, 2016-07-25 at 16:54 -0700, Kenneth Graunke wrote:
> There are a couple cases where a single shader might happen:
> 
> - compute shaders
>   (only one stage, no inputs and outputs; separable shouldn't matter)
> - vertex shaders with transform feedback
>   (we want to retain outputs, but transform feedback varyings are
>    specified via the API, not the shader - setting SSO fixes this)

ARB_enhanced_layouts does allow these to be specified in shader
although that might be difficult to recognise.

Also this will retain all varyings not just xfb varyings maybe we
should capture xfb varyings when dumping shaders as this also doesn't
fix xfb for say vs->gs or even vs->fs. Anyway just a thought, I guess
this patch probably does make things better than worse.

> - old shader_test files captured before we started adding "SSO
> ENABLED".
> 
> In any case, it seems harmless or beneficial to enable SSO for all
> .shader_test files containing a single shader.
> 
> Based on a patch by Marek.
> ---
>  run.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/run.c b/run.c
> index 024c8e9..f6ce1bf 100644
> --- a/run.c
> +++ b/run.c
> @@ -633,6 +633,12 @@ main(int argc, char **argv)
>              }
>              ctx_is_core = type == TYPE_CORE;
>  
> +            /* If there's only one shader, mark it separable so
> inputs
> +             * and outputs aren't eliminated.
> +             */
> +            if (num_shaders == 1)
> +                use_separate_shader_objects = true;
> +
>              if (type == TYPE_CORE || type == TYPE_COMPAT) {
>                  GLuint prog = glCreateProgram();
>  


More information about the mesa-dev mailing list