[Mesa-dev] [PATCH 1/3] glsl: build up a mask of active shader stages in a program

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Mon Dec 7 02:18:55 PST 2015


small comment on patch 2, otherwise these are

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>

/Juha-Pekka

On 07.12.2015 11:29, Tapani Pälli wrote:
> This will be used for validating SSO pipeline where all active stages
> in linked programs should be in use when rendering.
>
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>   src/glsl/linker.cpp    | 4 ++++
>   src/mesa/main/mtypes.h | 1 +
>   2 files changed, 5 insertions(+)
>
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index ae628cd..4150d40 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -4611,11 +4611,15 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
>      }
>
>   done:
> +   prog->ActiveStages = 0;
> +
>      for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
>         free(shader_list[i]);
>         if (prog->_LinkedShaders[i] == NULL)
>   	 continue;
>
> +      prog->ActiveStages |= (1 << i);
> +
>         /* Do a final validation step to make sure that the IR wasn't
>          * invalidated by any modifications performed after intrastage linking.
>          */
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 1eb1e21..fa7ead0 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -2556,6 +2556,7 @@ struct gl_shader_program
>      GLboolean SeparateShader;
>
>      GLuint NumShaders;          /**< number of attached shaders */
> +   uint8_t ActiveStages;       /**< mask of active shader stages */
>      struct gl_shader **Shaders; /**< List of attached the shaders */
>
>      /**
>



More information about the mesa-dev mailing list