summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/d3d1x
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-09-27 18:08:58 +0200
committerLuca Barbieri <luca@luca-barbieri.com>2010-09-27 22:20:53 +0200
commitdb6f1d0436b66435bac5e2b6db5d2f4e07e80473 (patch)
tree16555f69c0efbb528e17b0e60dfb60f34b14e665 /src/gallium/state_trackers/d3d1x
parentff531c5b05cb4c078b42c6b14e707646d3d158c9 (diff)
d3d1x: support centroid interpolation
Diffstat (limited to 'src/gallium/state_trackers/d3d1x')
-rw-r--r--src/gallium/state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/gallium/state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp b/src/gallium/state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp
index 66b686687c..615ce8c255 100644
--- a/src/gallium/state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp
+++ b/src/gallium/state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp
@@ -37,18 +37,24 @@
#define fail(x) throw(x)
#endif
-static unsigned sm4_to_pipe_interpolation[] =
+struct tgsi_interpolation
{
- TGSI_INTERPOLATE_PERSPECTIVE, /* UNDEFINED */
- TGSI_INTERPOLATE_CONSTANT,
- TGSI_INTERPOLATE_PERSPECTIVE, /* LINEAR */
- TGSI_INTERPOLATE_PERSPECTIVE, /* LINEAR_CENTROID */
- TGSI_INTERPOLATE_LINEAR, /* LINEAR_NOPERSPECTIVE */
- TGSI_INTERPOLATE_LINEAR, /* LINEAR_NOPERSPECTIVE_CENTROID */
+ unsigned interpolation;
+ bool centroid;
+};
+
+static tgsi_interpolation sm4_to_pipe_interpolation[] =
+{
+ {TGSI_INTERPOLATE_PERSPECTIVE, false}, /* UNDEFINED */
+ {TGSI_INTERPOLATE_CONSTANT, false},
+ {TGSI_INTERPOLATE_PERSPECTIVE, false}, /* LINEAR */
+ {TGSI_INTERPOLATE_PERSPECTIVE, true}, /* LINEAR_CENTROID */
+ {TGSI_INTERPOLATE_LINEAR, false}, /* LINEAR_NOPERSPECTIVE */
+ {TGSI_INTERPOLATE_LINEAR, true}, /* LINEAR_NOPERSPECTIVE_CENTROID */
// Added in D3D10.1
- TGSI_INTERPOLATE_PERSPECTIVE, /* LINEAR_SAMPLE */
- TGSI_INTERPOLATE_LINEAR, /* LINEAR_NOPERSPECTIVE_SAMPLE */
+ {TGSI_INTERPOLATE_PERSPECTIVE, true}, /* LINEAR_SAMPLE */
+ {TGSI_INTERPOLATE_LINEAR, true}, /* LINEAR_NOPERSPECTIVE_SAMPLE */
};
static int sm4_to_pipe_sv[] =
@@ -741,7 +747,7 @@ next:;
check(idx >= 0);
if(inputs.size() <= (unsigned)idx)
inputs.resize(idx + 1);
- inputs[idx] = ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_GENERIC, idx, sm4_to_pipe_interpolation[dcl.dcl_input_ps.interpolation]);
+ inputs[idx] = ureg_DECL_fs_input_cyl_centroid(ureg, TGSI_SEMANTIC_GENERIC, idx, sm4_to_pipe_interpolation[dcl.dcl_input_ps.interpolation].interpolation, 0, sm4_to_pipe_interpolation[dcl.dcl_input_ps.interpolation].centroid);
break;
case SM4_OPCODE_DCL_OUTPUT:
check(idx >= 0);