aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_program.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_program.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_program.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_program.c b/mesalib/src/mesa/state_tracker/st_program.c
index 146e77f9d..e03157940 100644
--- a/mesalib/src/mesa/state_tracker/st_program.c
+++ b/mesalib/src/mesa/state_tracker/st_program.c
@@ -416,7 +416,9 @@ st_get_vp_variant(struct st_context *st,
return vpv;
}
-static int st_translate_interp(enum glsl_interp_qualifier glsl_qual)
+
+static unsigned
+st_translate_interp(enum glsl_interp_qualifier glsl_qual)
{
switch (glsl_qual) {
case INTERP_QUALIFIER_NONE:
@@ -426,11 +428,13 @@ static int st_translate_interp(enum glsl_interp_qualifier glsl_qual)
return TGSI_INTERPOLATE_CONSTANT;
case INTERP_QUALIFIER_NOPERSPECTIVE:
return TGSI_INTERPOLATE_LINEAR;
+ default:
+ assert(0 && "unexpected interp mode in st_translate_interp()");
+ return TGSI_INTERPOLATE_PERSPECTIVE;
}
- assert(0);
- return TGSI_INTERPOLATE_PERSPECTIVE;
}
+
/**
* Translate a Mesa fragment shader into a TGSI shader using extra info in
* the key.
@@ -632,8 +636,10 @@ st_translate_fragment_program(struct st_context *st,
}
ureg = ureg_create( TGSI_PROCESSOR_FRAGMENT );
- if (ureg == NULL)
+ if (ureg == NULL) {
+ FREE(variant);
return NULL;
+ }
if (ST_DEBUG & DEBUG_MESA) {
_mesa_print_program(&stfp->Base.Base);