glsl: use is_image() anywhere it's possible
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 24 Feb 2017 13:40:20 +0000 (14:40 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 27 Feb 2017 18:41:11 +0000 (19:41 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/link_uniform_initializers.cpp
src/compiler/glsl_types.cpp
src/mesa/main/uniform_query.cpp

index fe0841f..7e5b80d 100644 (file)
@@ -140,7 +140,7 @@ set_opaque_binding(void *mem_ctx, gl_shader_program *prog,
                      storage->storage[i].i;
                }
 
-            } else if (storage->type->base_type == GLSL_TYPE_IMAGE &&
+            } else if (storage->type->is_image() &&
                     storage->opaque[sh].active) {
                for (unsigned i = 0; i < elements; i++) {
                   const unsigned index = storage->opaque[sh].index + i;
index a431edc..7cbb211 100644 (file)
@@ -2032,8 +2032,7 @@ glsl_type::coordinate_components() const
     * cubemap faces.
     */
    if (sampler_array &&
-       !(base_type == GLSL_TYPE_IMAGE &&
-         sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE))
+       !(is_image() && sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE))
       size += 1;
 
    return size;
index cb1c51f..010a7b2 100644 (file)
@@ -356,7 +356,7 @@ _mesa_get_uniform(struct gl_context *ctx, GLuint program, GLint location,
              (uni->type->base_type == GLSL_TYPE_INT
               || uni->type->base_type == GLSL_TYPE_UINT
                || uni->type->base_type == GLSL_TYPE_SAMPLER
-               || uni->type->base_type == GLSL_TYPE_IMAGE))
+               || uni->type->is_image()))
           || ((returnType == GLSL_TYPE_UINT64 ||
                returnType == GLSL_TYPE_INT64 ) &&
               (uni->type->base_type == GLSL_TYPE_UINT64 ||