diff options
author | Dave Airlie <[email protected]> | 2012-01-09 15:57:02 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2012-01-10 11:54:44 +0000 |
commit | 67e3cbf1632e361220234013147331e4618b70cb (patch) | |
tree | 9b8499ffa141c376cb3ce706c0bc67d7cabafa70 /src/gallium/drivers/softpipe/sp_state_derived.c | |
parent | 5a7c3433521f50ee06883728f86bc4bbf1bf479b (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/sp_state_derived.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_state_derived.c | 10 |
1 files changed, 8 insertions, 2 deletions
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; } |