glsl: Use the without_array predicate in some more places
authorTimothy Arceri <t_arceri@yahoo.com.au>
Tue, 19 Aug 2014 23:56:42 +0000 (13:56 -1000)
committerMatt Turner <mattst88@gmail.com>
Wed, 20 Aug 2014 00:44:06 +0000 (17:44 -0700)
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
src/glsl/link_uniform_initializers.cpp
src/mesa/program/ir_to_mesa.cpp

index a745c7cace3d8515de59bf21aa3c75a348785de3..f6a60bce99337637eb1501056a31a44e37fb7b79 100644 (file)
@@ -259,8 +259,7 @@ link_set_uniform_initializers(struct gl_shader_program *prog,
          if (var->data.explicit_binding) {
             const glsl_type *const type = var->type;
 
-            if (type->is_sampler()
-                || (type->is_array() && type->fields.array->is_sampler())) {
+            if (type->without_array()->is_sampler()) {
                linker::set_sampler_binding(prog, var->name, var->data.binding);
             } else if (var->is_in_uniform_block()) {
                const glsl_type *const iface_type = var->get_interface_type();
index 011ffed7bb4c5b90c03581220811d5db2a48800b..e5844c3c437d86fa64026d0bf8c164ce66888e07 100644 (file)
@@ -2432,8 +2432,7 @@ add_uniform_to_shader::visit_field(const glsl_type *type, const char *name,
    }
 
    gl_register_file file;
-   if (type->is_sampler() ||
-       (type->is_array() && type->fields.array->is_sampler())) {
+   if (type->without_array()->is_sampler()) {
       file = PROGRAM_SAMPLER;
    } else {
       file = PROGRAM_UNIFORM;