[Mesa-dev] [PATCH 1/2] glsl: subroutine types cannot be used in constructors.

Iago Toral itoral at igalia.com
Tue May 3 14:08:08 UTC 2016


Looks good to me,
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

On Tue, 2016-05-03 at 14:39 +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> This fixes two of the cases in
> GL43-CTS.shader_subroutine.subroutines_not_allowed_as_variables_constructors_and_argument_or_return_types
> 
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/compiler/glsl/ast_function.cpp | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp
> index f50c7bf..37fb3e79 100644
> --- a/src/compiler/glsl/ast_function.cpp
> +++ b/src/compiler/glsl/ast_function.cpp
> @@ -1819,6 +1819,12 @@ ast_function_expression::hir(exec_list *instructions,
>  	 return ir_rvalue::error_value(ctx);
>        }
>  
> +      if (constructor_type->is_subroutine()) {
> +         _mesa_glsl_error(& loc, state, "subroutine name cannot be a constructor `%s'",
> +                          constructor_type->name);
> +	 return ir_rvalue::error_value(ctx);
> +      }
> +
>        if (constructor_type->is_array()) {
>           if (!state->check_version(120, 300, &loc,
>                                     "array constructors forbidden")) {




More information about the mesa-dev mailing list