diff options
author | Kenneth Graunke <[email protected]> | 2014-09-08 14:28:39 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2014-09-09 13:19:44 -0700 |
commit | e36bbff0e6d6d2baeaeab153b93e201674be2056 (patch) | |
tree | 67ca2cc3205760ecc58a05e26eb9b3727c232af9 | |
parent | c68073e65f15b0df43bec2df1d7470ed4cddd761 (diff) |
ir_to_mesa: Stop converting uniform booleans.
Excess conversions considered harmful.
Recently Matt reworked the boolean uniform handling to use the value of
UniformBooleanTrue, rather than integer 1, when uploading uniforms:
mesa: Upload boolean uniforms using UniformBooleanTrue.
glsl: Use UniformBooleanTrue value for uniform initializers.
Marek then set the default to 1.0f for drivers without native integer
support:
mesa: set UniformBooleanTrue = 1.0f by default
However, ir_to_mesa was assuming a value of integer 1, and arranging for
it to be converted to 1.0f on upload. Since Marek's commit, we were
uploading 1.0f = 0x3f800000 which was being interpreted as the integer
value 1065353216 and converted to float as 1.06535322E9, which broke
assumptions in ir_to_mesa that "true" was exactly 1.0f.
+13 Piglits on classic swrast (fs-bool-less-compare-true,
{vs,fs}-op-not-bool-using-if, glsl-1.20/execution/uniform-initializer).
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83573
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
-rw-r--r-- | src/mesa/program/ir_to_mesa.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 49e4a7a40eb..293fe34b9e4 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -2505,12 +2505,7 @@ _mesa_associate_uniform_storage(struct gl_context *ctx, columns = storage->type->matrix_columns; break; case GLSL_TYPE_BOOL: - if (ctx->Const.NativeIntegers) { - format = (ctx->Const.UniformBooleanTrue == 1) - ? uniform_bool_int_0_1 : uniform_bool_int_0_not0; - } else { - format = uniform_bool_float; - } + format = uniform_native; columns = 1; break; case GLSL_TYPE_SAMPLER: |