Mesa (master): r300g: make pow(0,0) return 1 instead of NaN in the R500 fragment shader

Corbin Simpson csimpson at kemper.freedesktop.org
Wed Dec 9 21:38:25 UTC 2009


Module: Mesa
Branch: master
Commit: 87b822e024797ef2fdb51ec9364f21eeb4d07161
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=87b822e024797ef2fdb51ec9364f21eeb4d07161

Author: Marek Olšák <maraeo at gmail.com>
Date:   Tue Dec  8 04:55:32 2009 +0100

r300g: make pow(0,0) return 1 instead of NaN in the R500 fragment shader

Unfortunately we can't fix this easily in the R300 fragment shader,
and it's probably not worth the effort.

---

 src/gallium/drivers/r300/r300_emit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 7620c73..55bc2b3 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -277,7 +277,7 @@ void r500_emit_fragment_program_code(struct r300_context* r300,
 
     BEGIN_CS(13 +
              ((code->inst_end + 1) * 6));
-    OUT_CS_REG(R500_US_CONFIG, 0);
+    OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO);
     OUT_CS_REG(R500_US_PIXSIZE, code->max_temp_idx);
     OUT_CS_REG(R500_US_CODE_RANGE,
                R500_US_CODE_RANGE_ADDR(0) | R500_US_CODE_RANGE_SIZE(code->inst_end));




More information about the mesa-commit mailing list