Merge remote-tracking branch 'mesa-public/master' into vulkan
[mesa.git] / src / glsl / link_uniform_initializers.cpp
index 5f57079d1b8ccaf422cf147f7865fedf1c32ffc0..c482fbfdfb201fb87b1481d40c9d5c7936ce945d 100644 (file)
@@ -90,6 +90,7 @@ copy_constant_to_storage(union gl_constant_value *storage,
       case GLSL_TYPE_INTERFACE:
       case GLSL_TYPE_FUNCTION:
       case GLSL_TYPE_VOID:
+      case GLSL_TYPE_SUBROUTINE:
       case GLSL_TYPE_ERROR:
         /* All other types should have already been filtered by other
          * paths in the caller.
@@ -257,7 +258,8 @@ link_set_uniform_initializers(struct gl_shader_program *prog,
       foreach_in_list(ir_instruction, node, shader->ir) {
         ir_variable *const var = node->as_variable();
 
-        if (!var || var->data.mode != ir_var_uniform)
+        if (!var || (var->data.mode != ir_var_uniform &&
+            var->data.mode != ir_var_shader_storage))
            continue;
 
         if (!mem_ctx)
@@ -268,7 +270,7 @@ link_set_uniform_initializers(struct gl_shader_program *prog,
 
             if (type->without_array()->is_sampler()) {
                linker::set_sampler_binding(prog, var->name, var->data.binding);
-            } else if (var->is_in_uniform_block()) {
+            } else if (var->is_in_buffer_block()) {
                const glsl_type *const iface_type = var->get_interface_type();
 
                /* If the variable is an array and it is an interface instance,
@@ -281,7 +283,7 @@ link_set_uniform_initializers(struct gl_shader_program *prog,
                 *         float f[4];
                 *     };
                 *
-                * In this case "f" would pass is_in_uniform_block (above) and
+                * In this case "f" would pass is_in_buffer_block (above) and
                 * type->is_array(), but it will fail is_interface_instance().
                 */
                if (var->is_interface_instance() && var->type->is_array()) {