[Mesa-dev] [PATCH 18/29] nir/glsl_to_nir: set the bit-size in the result of evaluate_rvalue
Samuel Iglesias Gonsálvez
siglesias at igalia.com
Mon Mar 21 12:05:57 UTC 2016
From: Iago Toral Quiroga <itoral at igalia.com>
Found while testing UBO loads in scenarios like this:
(assign (x) (var_ref vec_ctor)
(expression float d2f
(expression double ubo_load (constant uint (0)) (constant uint (0)))))
Without this patch, the src expression of d2f would be evaluated to a bitsize
of 32, which is not correct and would hit an assert in nir_validate.
---
src/compiler/nir/glsl_to_nir.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/compiler/nir/glsl_to_nir.cpp b/src/compiler/nir/glsl_to_nir.cpp
index f9ec0d5..498733f 100644
--- a/src/compiler/nir/glsl_to_nir.cpp
+++ b/src/compiler/nir/glsl_to_nir.cpp
@@ -1187,6 +1187,7 @@ nir_visitor::evaluate_rvalue(ir_rvalue* ir)
load_instr->dest.ssa.bit_size = glsl_get_bit_size(ir->type->base_type);
}
+ this->result->bit_size = glsl_get_bit_size(ir->type->base_type);
return this->result;
}
--
2.5.0
More information about the mesa-dev
mailing list