summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_state_derived.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-02-26 10:13:39 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-02-26 10:13:39 -0700
commitf74279002a0ae0b106bd5410487ef9c0e9b1d8b6 (patch)
treef9273881651ea0df206c6281337f6872df2878db /src/gallium/drivers/softpipe/sp_state_derived.c
parent1410b7bb509ef37c41043b173bc1047257483af0 (diff)
gallium: added tgsi_shader_field to sp_fragment_shader
Use the shader semantic info from there, instead of from pipe_shader_state. Carry this idea to draw module and other drivers...
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_state_derived.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_state_derived.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_derived.c b/src/gallium/drivers/softpipe/sp_state_derived.c
index 4c6313001f..68702eafcf 100644
--- a/src/gallium/drivers/softpipe/sp_state_derived.c
+++ b/src/gallium/drivers/softpipe/sp_state_derived.c
@@ -62,6 +62,7 @@ softpipe_get_vertex_info(struct softpipe_context *softpipe)
if (vinfo->num_attribs == 0) {
/* compute vertex layout now */
const struct pipe_shader_state *vs = &softpipe->vs->shader;
+ const struct sp_fragment_shader *spfs = softpipe->fs;
const struct pipe_shader_state *fs = &softpipe->fs->shader;
const enum interp_mode colorInterp
= softpipe->rasterizer->flatshade ? INTERP_CONSTANT : INTERP_LINEAR;
@@ -83,9 +84,9 @@ softpipe_get_vertex_info(struct softpipe_context *softpipe)
* from the vertex shader.
*/
vinfo->num_attribs = 0;
- for (i = 0; i < fs->num_inputs; i++) {
+ for (i = 0; i < spfs->info.num_inputs; i++) {
int src;
- switch (fs->input_semantic_name[i]) {
+ switch (spfs->info.input_semantic_name[i]) {
case TGSI_SEMANTIC_POSITION:
src = draw_find_vs_output(softpipe->draw,
TGSI_SEMANTIC_POSITION, 0);
@@ -94,7 +95,7 @@ softpipe_get_vertex_info(struct softpipe_context *softpipe)
case TGSI_SEMANTIC_COLOR:
src = draw_find_vs_output(softpipe->draw, TGSI_SEMANTIC_COLOR,
- fs->input_semantic_index[i]);
+ spfs->info.input_semantic_index[i]);
draw_emit_vertex_attr(vinfo, EMIT_4F, colorInterp, src);
break;
@@ -106,7 +107,7 @@ softpipe_get_vertex_info(struct softpipe_context *softpipe)
case TGSI_SEMANTIC_GENERIC:
/* this includes texcoords and varying vars */
src = draw_find_vs_output(softpipe->draw, TGSI_SEMANTIC_GENERIC,
- fs->input_semantic_index[i]);
+ spfs->info.input_semantic_index[i]);
draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, src);
break;