Mesa (master): gallium/ttn: Fix the type of gl_FragDepth.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 16 00:17:42 UTC 2018


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

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Sep 19 12:35:51 2018 -0700

gallium/ttn: Fix the type of gl_FragDepth.

In TGSI we have a vec4 of which only .z is used, but for NIR we should be
using a float the same as other NIR IR.  We were already moving TGSI's .z
to the .x channel.

Acked-by: Rob Clark <robdclark at gmail.com>

---

 src/gallium/auxiliary/nir/tgsi_to_nir.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index 12114dc203..4f7f900c24 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -344,6 +344,7 @@ ttn_emit_declaration(struct ttn_compile *c)
                }
                case TGSI_SEMANTIC_POSITION:
                   var->data.location = FRAG_RESULT_DEPTH;
+                  var->type = glsl_float_type();
                   break;
                default:
                   fprintf(stderr, "Bad TGSI semantic: %d/%d\n",




More information about the mesa-commit mailing list