summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-01-30 17:44:25 -0700
committerBrian Paul <[email protected]>2013-02-01 08:00:28 -0700
commit3cb491534493a52e9a88cb88d31727569afb8167 (patch)
tree3306310583a86f1b959287781ceb956a06dde9d8 /src/gallium/drivers/svga
parent9eff5e905ff435c0bf4e00f8c05871d1aadfbbc9 (diff)
svga: check for NaN shader immediates
The svga device doesn't handle them. Replace with zeros. Fixes several piglit tests, such as "glsl-const-builtin-inversesqrt". Reviewed-by: Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_tgsi_insn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c
index 36ed0089fba..d439e5b13aa 100644
--- a/src/gallium/drivers/svga/svga_tgsi_insn.c
+++ b/src/gallium/drivers/svga/svga_tgsi_insn.c
@@ -2716,8 +2716,10 @@ static boolean svga_emit_immediate( struct svga_shader_emitter *emit,
unsigned i;
assert(1 <= imm->Immediate.NrTokens && imm->Immediate.NrTokens <= 5);
- for (i = 0; i < imm->Immediate.NrTokens - 1; i++)
- value[i] = imm->u[i].Float;
+ for (i = 0; i < imm->Immediate.NrTokens - 1; i++) {
+ float f = imm->u[i].Float;
+ value[i] = util_is_inf_or_nan(f) ? 0.0f : f;
+ }
for ( ; i < 4; i++ )
value[i] = id[i];