glsl: Forbid calling the constructor of any opaque type.

The spec doesn't define any opaque type constructors.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Francisco Jerez 2014-12-04 10:40:56 +02:00
parent c4111dfa0a
commit e6146e6f14
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}