Integrated glsl-optimizer.

This commit is contained in:
Branimir Karadžić
2017-03-22 16:01:23 -07:00
parent 7a290e0de6
commit 9908ae000b
2 changed files with 10 additions and 4 deletions

View File

@@ -31,3 +31,7 @@ indent_size = 4
[remotery/*]
indent_style = space
indent_size = 4
[glsl-optimizer/*]
indent_style = space
indent_size = 3

View File

@@ -3045,10 +3045,12 @@ process_initializer(ir_variable *var, ast_declaration *decl,
/* Propagate precision qualifier for constant value */
if (type->qualifier.flags.q.constant) {
ir_constant *constant_value = rhs->constant_expression_value();
constant_value->set_precision((glsl_precision)type->qualifier.precision);
if (constant_value->type->is_array()) {
for (unsigned i = 0; i < constant_value->type->length; i++) {
constant_value->get_array_element(i)->set_precision((glsl_precision)type->qualifier.precision);
if (NULL != constant_value) {
constant_value->set_precision((glsl_precision)type->qualifier.precision);
if (constant_value->type->is_array()) {
for (unsigned i = 0; i < constant_value->type->length; i++) {
constant_value->get_array_element(i)->set_precision((glsl_precision)type->qualifier.precision);
}
}
}
}