aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_program.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-11-04 08:57:20 +0100
committermarha <marha@users.sourceforge.net>2011-11-04 08:57:20 +0100
commit02f377d5e2dd18537d0807ad63675a0970b5a37d (patch)
tree1814c826db4d95a30ad71431d9c84b8d2611ec18 /mesalib/src/mesa/state_tracker/st_program.c
parent6f4feafd4d22beaabfb0202e66b0dea9047ee084 (diff)
downloadvcxsrv-02f377d5e2dd18537d0807ad63675a0970b5a37d.tar.gz
vcxsrv-02f377d5e2dd18537d0807ad63675a0970b5a37d.tar.bz2
vcxsrv-02f377d5e2dd18537d0807ad63675a0970b5a37d.zip
xserver pixman mesa git update 4 nov 2011
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_program.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_program.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_program.c b/mesalib/src/mesa/state_tracker/st_program.c
index c419c4066..146e77f9d 100644
--- a/mesalib/src/mesa/state_tracker/st_program.c
+++ b/mesalib/src/mesa/state_tracker/st_program.c
@@ -416,6 +416,20 @@ st_get_vp_variant(struct st_context *st,
return vpv;
}
+static int st_translate_interp(enum glsl_interp_qualifier glsl_qual)
+{
+ switch (glsl_qual) {
+ case INTERP_QUALIFIER_NONE:
+ case INTERP_QUALIFIER_SMOOTH:
+ return TGSI_INTERPOLATE_PERSPECTIVE;
+ case INTERP_QUALIFIER_FLAT:
+ return TGSI_INTERPOLATE_CONSTANT;
+ case INTERP_QUALIFIER_NOPERSPECTIVE:
+ return TGSI_INTERPOLATE_LINEAR;
+ }
+ assert(0);
+ return TGSI_INTERPOLATE_PERSPECTIVE;
+}
/**
* Translate a Mesa fragment shader into a TGSI shader using extra info in
@@ -558,7 +572,7 @@ st_translate_fragment_program(struct st_context *st,
if (attr == FRAG_ATTRIB_PNTC)
interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
else
- interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
+ interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr]);
break;
}
}