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

Author: Iago Toral Quiroga <ito...@igalia.com>
Date:   Mon Sep  9 08:42:19 2019 +0200

gallium/ttn: VARYING_SLOT_PSIZ and VARYING_SLOT_FOGC are scalar

Reviewed-by: Eric Anholt <e...@anholt.net>

---

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

diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c 
b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index a8c798f9015..140b011290f 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -437,6 +437,10 @@ ttn_emit_declaration(struct ttn_compile *c)
             } else {
                var->data.location =
                   tgsi_varying_semantic_to_slot(semantic_name, semantic_index);
+               if (var->data.location == VARYING_SLOT_FOGC ||
+                   var->data.location == VARYING_SLOT_PSIZ) {
+                  var->type = glsl_float_type();
+               }
             }
 
             if (is_array) {
@@ -2373,6 +2377,12 @@ ttn_add_output_stores(struct ttn_compile *c)
             store_value = nir_channel(b, store_value, 2);
          else if (var->data.location == FRAG_RESULT_STENCIL)
             store_value = nir_channel(b, store_value, 1);
+      } else {
+         /* FOGC and PSIZ are scalar values */
+         if (var->data.location == VARYING_SLOT_FOGC ||
+             var->data.location == VARYING_SLOT_PSIZ) {
+            store_value = nir_channel(b, store_value, 0);
+         }
       }
 
       nir_store_deref(b, nir_build_deref_var(b, var), store_value,

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to