diff options
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_quad_fs.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_state_derived.c | 10 |
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; } |