[Mesa-dev] [PATCH 02/19] glsl: Fix block name of built-in gl_PerVertex interface block.

Kenneth Graunke kenneth at whitecape.org
Sat Oct 5 12:10:40 PDT 2013


On 10/02/2013 05:45 PM, Paul Berry wrote:
> Previously, we erroneously used the name "gl_in" for both the block
> name and the instance name.
> ---
>  src/glsl/builtin_variables.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
> index 3667dc8..91518ba 100644
> --- a/src/glsl/builtin_variables.cpp
> +++ b/src/glsl/builtin_variables.cpp
> @@ -827,7 +827,7 @@ builtin_variable_generator::generate_varyings()
>           glsl_type::get_interface_instance(this->per_vertex_fields,
>                                             this->num_per_vertex_fields,
>                                             GLSL_INTERFACE_PACKING_STD140,
> -                                           "gl_in");
> +                                           "gl_PerVertex");
>        ir_variable *var = add_variable("gl_in", array(per_vertex_type, 0),
>                                        ir_var_shader_in, -1);
>        var->init_interface_type(per_vertex_type);

It would be fantastic if you could update the prototype in glsl_types.h to
say "block_name" instead of "name" for the parameter:

   /**
    * Get the instance of an interface block type
    */
   static const glsl_type *get_interface_instance(const glsl_struct_field *fields,
                                                  unsigned num_fields,
                                                  enum glsl_interface_packing packing,
                                                  const char *name);

With just "name", it's not obvious which is supposed to be passed here.

Either way, patches 1-2 are:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list