[Mesa-dev] [PATCH 2/7] glsl: Forbid calling the constructor of any opaque type.

Ian Romanick idr at freedesktop.org
Sun Feb 1 01:47:04 PST 2015


This patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

On 01/31/2015 09:54 PM, Francisco Jerez wrote:
> The spec doesn't define any opaque type constructors.
> ---
>  src/glsl/ast_function.cpp | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
> index cbff9d8..151b082 100644
> --- a/src/glsl/ast_function.cpp
> +++ b/src/glsl/ast_function.cpp
> @@ -1524,10 +1524,10 @@ ast_function_expression::hir(exec_list *instructions,
>        }
>  
>  
> -      /* Constructors for samplers are illegal.
> +      /* Constructors for opaque types are illegal.
>         */
> -      if (constructor_type->is_sampler()) {
> -	 _mesa_glsl_error(& loc, state, "cannot construct sampler type `%s'",
> +      if (constructor_type->contains_opaque()) {
> +	 _mesa_glsl_error(& loc, state, "cannot construct opaque type `%s'",
>  			  constructor_type->name);
>  	 return ir_rvalue::error_value(ctx);
>        }
> 



More information about the mesa-dev mailing list