glsl: Forbid calling the constructor of any opaque type.
[mesa.git] / 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);
       }