diff options
author | Keith Whitwell <keithw@vmware.com> | 2010-11-22 10:36:01 +0000 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2010-11-22 10:36:01 +0000 |
commit | b2ddb93ff3b8c88682634ccdef247967e31fab84 (patch) | |
tree | 495da09bbeddd9fdb51e4301c113bcf4ae94c8e4 /src/gallium/drivers/llvmpipe/lp_state_derived.c | |
parent | d5aadf0d80e8c973ef5cf9d82e97f23f0e3c032b (diff) | |
parent | 546c5ffa11d70631348e5776df7a4168f07600f6 (diff) |
Merge branch 'lp-offset-twoside'
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_state_derived.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_derived.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_derived.c b/src/gallium/drivers/llvmpipe/lp_state_derived.c index 0f5f7369e0..8725ea39fe 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_derived.c +++ b/src/gallium/drivers/llvmpipe/lp_state_derived.c @@ -53,6 +53,11 @@ compute_vertex_info(struct llvmpipe_context *llvmpipe) unsigned vs_index; uint i; + llvmpipe->color_slot[0] = ~0; + llvmpipe->color_slot[1] = ~0; + llvmpipe->bcolor_slot[0] = ~0; + llvmpipe->bcolor_slot[1] = ~0; + /* * Match FS inputs against VS outputs, emitting the necessary * attributes. Could cache these structs and look them up with a @@ -76,12 +81,31 @@ compute_vertex_info(struct llvmpipe_context *llvmpipe) lpfs->info.base.input_semantic_name[i], lpfs->info.base.input_semantic_index[i]); + if (lpfs->info.base.input_semantic_name[i] == TGSI_SEMANTIC_COLOR && + lpfs->info.base.input_semantic_index[i] < 2) { + int idx = lpfs->info.base.input_semantic_index[i]; + llvmpipe->color_slot[idx] = vinfo->num_attribs; + } + /* * Emit the requested fs attribute for all but position. */ draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, vs_index); } + /* Figure out if we need bcolor as well. + */ + for (i = 0; i < 2; i++) { + vs_index = draw_find_shader_output(llvmpipe->draw, + TGSI_SEMANTIC_BCOLOR, i); + + if (vs_index > 0) { + llvmpipe->bcolor_slot[i] = vinfo->num_attribs; + draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, vs_index); + } + } + + /* Figure out if we need pointsize as well. */ vs_index = draw_find_shader_output(llvmpipe->draw, |