[Mesa-dev] [PATCH] glsl: use linked shaders rather than compiled shaders

Iago Toral itoral at igalia.com
Mon Jul 18 13:46:03 UTC 2016


Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>


On Mon, 2016-07-11 at 12:11 +1000, Timothy Arceri wrote:
> At this point there is no reason not to be using the linked shaders,
> using the linked shaders should be faster and will make things
> simpler
> for upcoming shader cache work.
> 
> The previous variable name suggests the linked shaders were intended
> to be used here anyway.
> ---
>  src/compiler/glsl/linker.cpp | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/compiler/glsl/linker.cpp
> b/src/compiler/glsl/linker.cpp
> index 527b636..5719c87 100644
> --- a/src/compiler/glsl/linker.cpp
> +++ b/src/compiler/glsl/linker.cpp
> @@ -4116,12 +4116,12 @@ calculate_array_size_and_stride(struct
> gl_shader_program *shProg,
>        }
>     }
>  
> -   for (unsigned i = 0; i < shProg->NumShaders; i++) {
> -      if (shProg->Shaders[i] == NULL)
> +   for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
> +      const gl_linked_shader *sh = shProg->_LinkedShaders[i];
> +      if (sh == NULL)
>           continue;
>  
> -      const gl_shader *stage = shProg->Shaders[i];
> -      foreach_in_list(ir_instruction, node, stage->ir) {
> +      foreach_in_list(ir_instruction, node, sh->ir) {
>           ir_variable *var = node->as_variable();
>           if (!var || !var->get_interface_type() ||
>               var->data.mode != ir_var_shader_storage)


More information about the mesa-dev mailing list