summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_vs_varient.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-06-11 23:48:13 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-06-11 23:48:45 +0100
commit2161b0fafcdc16703162dd489d2ec1e7114cce4c (patch)
tree4e192f064c7416c9fb59012d586d1fc87afdf877 /src/gallium/auxiliary/draw/draw_vs_varient.c
parent807f8f177b3a2833806d84a70e71019f8849239f (diff)
draw: don't assume vertex position is in data[0]
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vs_varient.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_varient.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs_varient.c b/src/gallium/auxiliary/draw/draw_vs_varient.c
index abe8c5ec2d..ad0b829afa 100644
--- a/src/gallium/auxiliary/draw/draw_vs_varient.c
+++ b/src/gallium/auxiliary/draw/draw_vs_varient.c
@@ -89,6 +89,8 @@ static void do_rhw_viewport( struct draw_vs_varient_generic *vsvg,
unsigned stride = vsvg->temp_vertex_stride;
unsigned j;
+ ptr += vsvg->base.vs->position_output * 4 * sizeof(float);
+
for (j = 0; j < count; j++, ptr += stride) {
float *data = (float *)ptr;
float w = 1.0f / data[3];
@@ -110,6 +112,8 @@ static void do_viewport( struct draw_vs_varient_generic *vsvg,
unsigned stride = vsvg->temp_vertex_stride;
unsigned j;
+ ptr += vsvg->base.vs->position_output * 4 * sizeof(float);
+
for (j = 0; j < count; j++, ptr += stride) {
float *data = (float *)ptr;