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
+2 -3
View File
@@ -1504,8 +1504,7 @@ emit_inline_matrix_constructor(const glsl_type *type,
* components with zero.
*/
glsl_base_type param_base_type = first_param->type->base_type;
assert(param_base_type == GLSL_TYPE_FLOAT ||
first_param->type->is_double());
assert(first_param->type->is_float() || first_param->type->is_double());
ir_variable *rhs_var =
new(ctx) ir_variable(glsl_type::get_instance(param_base_type, 4, 1),
"mat_ctor_vec",
@@ -1514,7 +1513,7 @@ emit_inline_matrix_constructor(const glsl_type *type,
ir_constant_data zero;
for (unsigned i = 0; i < 4; i++)
if (param_base_type == GLSL_TYPE_FLOAT)
if (first_param->type->is_float())
zero.f[i] = 0.0;
else
zero.d[i] = 0.0;