glsl: use is_image() anywhere it's possible

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
Samuel Pitoiset 2017-02-24 14:40:20 +01:00
parent 46562a062b
commit e12f4edf9c
3 changed files with 3 additions and 4 deletions

View File

@ -140,7 +140,7 @@ set_opaque_binding(void *mem_ctx, gl_shader_program *prog,
storage->storage[i].i; storage->storage[i].i;
} }
} else if (storage->type->base_type == GLSL_TYPE_IMAGE && } else if (storage->type->is_image() &&
storage->opaque[sh].active) { storage->opaque[sh].active) {
for (unsigned i = 0; i < elements; i++) { for (unsigned i = 0; i < elements; i++) {
const unsigned index = storage->opaque[sh].index + i; const unsigned index = storage->opaque[sh].index + i;

View File

@ -2032,8 +2032,7 @@ glsl_type::coordinate_components() const
* cubemap faces. * cubemap faces.
*/ */
if (sampler_array && if (sampler_array &&
!(base_type == GLSL_TYPE_IMAGE && !(is_image() && sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE))
sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE))
size += 1; size += 1;
return size; return size;

View 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_INT
|| uni->type->base_type == GLSL_TYPE_UINT || uni->type->base_type == GLSL_TYPE_UINT
|| uni->type->base_type == GLSL_TYPE_SAMPLER || 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_UINT64 ||
returnType == GLSL_TYPE_INT64 ) && returnType == GLSL_TYPE_INT64 ) &&
(uni->type->base_type == GLSL_TYPE_UINT64 || (uni->type->base_type == GLSL_TYPE_UINT64 ||