summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2012-01-09 15:57:02 +0000
committerDave Airlie <[email protected]>2012-01-10 11:54:44 +0000
commit67e3cbf1632e361220234013147331e4618b70cb (patch)
tree9b8499ffa141c376cb3ce706c0bc67d7cabafa70 /src/gallium/drivers/softpipe
parent5a7c3433521f50ee06883728f86bc4bbf1bf479b (diff)
gallium: introduce GLSL based interpolation rules. (v2)
This introduces an unspecified interpolation paramter that is only allowed for color semantics, so a specified GLSL interpolation will override the ShadeModel specified interpolation, but not vice-versa. This fixes a lot of the interpolation tests in piglit. v2: rename from unspecified to color Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_fs.c1
-rw-r--r--src/gallium/drivers/softpipe/sp_state_derived.c10
2 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/softpipe/sp_quad_fs.c b/src/gallium/drivers/softpipe/sp_quad_fs.c
index 7b08cd0cf30..7800ba8442f 100644
--- a/src/gallium/drivers/softpipe/sp_quad_fs.c
+++ b/src/gallium/drivers/softpipe/sp_quad_fs.c
@@ -74,6 +74,7 @@ shade_quad(struct quad_stage *qs, struct quad_header *quad)
struct tgsi_exec_machine *machine = softpipe->fs_machine;
/* run shader */
+ machine->flatshade_color = softpipe->rasterizer->flatshade ? TRUE : FALSE;
return softpipe->fs_variant->run( softpipe->fs_variant, machine, quad );
}
diff --git a/src/gallium/drivers/softpipe/sp_state_derived.c b/src/gallium/drivers/softpipe/sp_state_derived.c
index 56859971d8e..7b2b04e84e9 100644
--- a/src/gallium/drivers/softpipe/sp_state_derived.c
+++ b/src/gallium/drivers/softpipe/sp_state_derived.c
@@ -100,6 +100,9 @@ softpipe_get_vertex_info(struct softpipe_context *softpipe)
case TGSI_INTERPOLATE_PERSPECTIVE:
interp = INTERP_PERSPECTIVE;
break;
+ case TGSI_INTERPOLATE_COLOR:
+ assert(fsInfo->input_semantic_name[i] == TGSI_SEMANTIC_COLOR);
+ break;
default:
assert(0);
interp = INTERP_LINEAR;
@@ -111,8 +114,11 @@ softpipe_get_vertex_info(struct softpipe_context *softpipe)
break;
case TGSI_SEMANTIC_COLOR:
- if (softpipe->rasterizer->flatshade) {
- interp = INTERP_CONSTANT;
+ if (fsInfo->input_interpolate[i] == TGSI_INTERPOLATE_COLOR) {
+ if (softpipe->rasterizer->flatshade)
+ interp = INTERP_CONSTANT;
+ else
+ interp = INTERP_PERSPECTIVE;
}
break;
}