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

Author: Rob Clark <robcl...@freedesktop.org>
Date:   Mon Mar 21 13:56:04 2016 -0400

freedreno/ir3: handle VARYING_SLOT_PNTC

In the glsl->tgsi path, this already gets translated to VAR8, which
matches up with rasterizer->sprite_coord_enable.

Signed-off-by: Rob Clark <robcl...@freedesktop.org>

---

 src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c 
b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
index 33b2b7b..fc66d7c 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
@@ -2031,6 +2031,18 @@ setup_input(struct ir3_compile *ctx, nir_variable *in)
                                so->inputs[n].bary = false;
                                so->frag_coord = true;
                                instr = create_frag_coord(ctx, i);
+                       } else if (slot == VARYING_SLOT_PNTC) {
+                               /* see for example 
st_get_generic_varying_index().. this is
+                                * maybe a bit mesa/st specific.  But we need 
things to line
+                                * up for this in fdN_program:
+                                *    unsigned texmask = 1 << (slot - 
VARYING_SLOT_VAR0);
+                                *    if (emit->sprite_coord_enable & texmask) {
+                                *       ...
+                                *    }
+                                */
+                               so->inputs[n].slot = VARYING_SLOT_VAR8;
+                               so->inputs[n].bary = true;
+                               instr = create_frag_input(ctx, false);
                        } else if (slot == VARYING_SLOT_FACE) {
                                so->inputs[n].bary = false;
                                so->frag_face = true;

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

Reply via email to