From 67e3cbf1632e361220234013147331e4618b70cb Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 9 Jan 2012 15:57:02 +0000 Subject: 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 --- src/gallium/drivers/softpipe/sp_state_derived.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/softpipe/sp_state_derived.c') 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; } -- cgit v1.2.3