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 fe0841f472fa30b18f78c32569bae6c8f1a3045c..7e5b80d5c7e442259b550573bef5a7e9804a5378 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 a431edcdd3f010d45da7c8f514876f2fa856cdde..7cbb21112f2bf7180e6b6e011d4360b6384e2192 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 cb1c51fae30e0da0690a83e0c5de92dee4755e7b..010a7b24b1b4574e0ad42c0ddcc23e4a84fe59a5 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 ||