diff options
author | Keith Whitwell <[email protected]> | 2008-06-11 23:48:13 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2008-06-11 23:48:45 +0100 |
commit | 2161b0fafcdc16703162dd489d2ec1e7114cce4c (patch) | |
tree | 4e192f064c7416c9fb59012d586d1fc87afdf877 /src/gallium/auxiliary/draw/draw_vs.c | |
parent | 807f8f177b3a2833806d84a70e71019f8849239f (diff) |
draw: don't assume vertex position is in data[0]
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vs.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_vs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c index 979f9864fdb..978954e91c9 100644 --- a/src/gallium/auxiliary/draw/draw_vs.c +++ b/src/gallium/auxiliary/draw/draw_vs.c @@ -85,6 +85,16 @@ draw_create_vertex_shader(struct draw_context *draw, } } + if (vs) + { + uint i; + for (i = 0; i < vs->info.num_outputs; i++) { + if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_POSITION && + vs->info.output_semantic_index[i] == 0) + vs->position_output = i; + } + } + assert(vs); return vs; } @@ -100,6 +110,7 @@ draw_bind_vertex_shader(struct draw_context *draw, { draw->vs.vertex_shader = dvs; draw->vs.num_vs_outputs = dvs->info.num_outputs; + draw->vs.position_output = dvs->position_output; dvs->prepare( dvs, draw ); } else { |