st/nine: Use Position input helper for ps3 declared inputs
authorAxel Davy <axel.davy@ens.fr>
Sun, 21 Feb 2016 15:35:31 +0000 (16:35 +0100)
committerAxel Davy <axel.davy@ens.fr>
Mon, 29 Feb 2016 17:55:58 +0000 (18:55 +0100)
When the semantic is Position (which can happen with index 0 only),
use the helper to get Position input.

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/nine_shader.c

index f0c5236fd753d327df1a7b416f1cdeb06508a031..eb6479bb4d9ada791f7e9f96bbf475c0819d5b0b 100644 (file)
@@ -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),