Mesa (master): vc4: Add missing sRGB decode to texel fetches.

Eric Anholt anholt at kemper.freedesktop.org
Wed Jan 6 20:45:41 UTC 2016


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

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Jan  5 16:36:28 2016 -0800

vc4: Add missing sRGB decode to texel fetches.

We only see txf on MSAA textures, currently, and apparently this didn't
impact any of our piglit tests.

---

 src/gallium/drivers/vc4/vc4_program.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index 9d686f7..e04cca1 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -328,6 +328,11 @@ ntq_emit_txf(struct vc4_compile *c, nir_tex_instr *instr)
                 for (int i = 0; i < 4; i++)
                         dest[i] = qir_UNPACK_8_F(c, tex, i);
         }
+
+        for (int i = 0; i < 4; i++) {
+                if (c->tex_srgb_decode[unit] & (1 << i))
+                        dest[i] = qir_srgb_decode(c, dest[i]);
+        }
 }
 
 static void




More information about the mesa-commit mailing list