[Mesa-dev] [PATCH 2/2] st/nine: Use position input helper for ps3 declared inputs

Axel Davy axel.davy at ens.fr
Sun Feb 21 16:49:53 UTC 2016


When the semantic is position (which can happen with index 0 only),
use the helper to get position input.

Signed-off-by: Axel Davy <axel.davy at ens.fr>
---
The other changes of the initial patch (forbid POSITION0, etc)
will be part of another serie.

 src/gallium/state_trackers/nine/nine_shader.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c
index f0c5236..eb6479b 100644
--- a/src/gallium/state_trackers/nine/nine_shader.c
+++ b/src/gallium/state_trackers/nine/nine_shader.c
@@ -2052,9 +2052,16 @@ DECL_SPECIAL(DCL)
             unsigned interp_location = 0;
             /* SM3 only, SM2 input semantic determined by file */
             assert(sem.reg.idx < Elements(tx->regs.v));
+
+            if (tgsi.Name == TGSI_SEMANTIC_POSITION) {
+                tx->regs.v[sem.reg.idx] = nine_get_position_input(tx);
+                return D3D_OK;
+            }
+
             if (sem.reg.mod & NINED3DSPDM_CENTROID ||
                 (tgsi.Name == TGSI_SEMANTIC_COLOR && tx->info->force_color_in_centroid))
                 interp_location = TGSI_INTERPOLATE_LOC_CENTROID;
+
             tx->regs.v[sem.reg.idx] = ureg_DECL_fs_input_cyl_centroid(
                 ureg, tgsi.Name, tgsi.Index,
                 nine_tgsi_to_interp_mode(&tgsi),
-- 
2.7.1



More information about the mesa-dev mailing list