glsl: Forbid calling the constructor of any opaque type.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 4 Dec 2014 08:40:56 +0000 (10:40 +0200)
committerFrancisco Jerez <currojerez@riseup.net>
Tue, 10 Feb 2015 13:49:43 +0000 (15:49 +0200)
The spec doesn't define any opaque type constructors.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ast_function.cpp

index cbff9d8b452ba9fab7afda1f8cc6ab12fe03af3b..151b0825ea985d3e3cc9be10e210659e3e0a1f2a 100644 (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);
       }