glsl: make use of glsl_type::is_float()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
This commit is contained in:
Samuel Pitoiset
2017-04-21 11:18:50 +02:00
parent cacc823c39
commit a7bc51aef8
10 changed files with 48 additions and 56 deletions
+3 -3
View File
@@ -164,8 +164,8 @@ lower_buffer_access::emit_access(void *mem_ctx,
/* We're dereffing a column out of a row-major matrix, so we
* gather the vector from each stored row.
*/
assert(deref->type->base_type == GLSL_TYPE_FLOAT ||
deref->type->is_double());
assert(deref->type->is_float() || deref->type->is_double());
/* Matrices, row_major or not, are stored as if they were
* arrays of vectors of the appropriate size in std140.
* Arrays have their strides rounded up to a vec4, so the
@@ -199,7 +199,7 @@ lower_buffer_access::emit_access(void *mem_ctx,
else
matrix_stride = glsl_align(matrix_columns * N, 16);
const glsl_type *deref_type = deref->type->base_type == GLSL_TYPE_FLOAT ?
const glsl_type *deref_type = deref->type->is_float() ?
glsl_type::float_type : glsl_type::double_type;
for (unsigned i = 0; i < deref->type->vector_elements; i++) {