summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_pt_fetch.c
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2013-06-27 20:40:10 -0400
committerZack Rusin <zackr@vmware.com>2013-06-28 05:21:20 -0400
commit1c2e5c223da28cdffe156b6b430fcdf638909021 (patch)
treef86833cf8b5b43134231309cc75932da000de080 /src/gallium/auxiliary/draw/draw_pt_fetch.c
parentdf4ab7974a825bf686f9dfa3474f3648e9a3ca66 (diff)
downloadexternal_mesa3d-1c2e5c223da28cdffe156b6b430fcdf638909021.zip
external_mesa3d-1c2e5c223da28cdffe156b6b430fcdf638909021.tar.gz
external_mesa3d-1c2e5c223da28cdffe156b6b430fcdf638909021.tar.bz2
draw/translate: fix instancing
We were incorrectly computing the buffer offset when using the instances. The buffer offset is always equal to: start_instance * stride + (instance_num / instance_divisor) * stride We were completely ignoring the start instance quite often producing instances that completely wrong, e.g. if start instance = 5, instance divisor = 2, then on the first iteration it should be: 5 * stride, not (5/2) * stride as we'd have currently, and if start instance = 1, instance divisor = 3, then on the first iteration it should be: 1 * stride, not 0 as we'd have. This fixes it and adjusts all the code to the changes. Signed-off-by: Zack Rusin <zackr@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt_fetch.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch.c b/src/gallium/auxiliary/draw/draw_pt_fetch.c
index 3740dea..8716f65 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch.c
@@ -168,6 +168,7 @@ draw_pt_fetch_run(struct pt_fetch *fetch,
translate->run_elts( translate,
elts,
count,
+ draw->start_instance,
draw->instance_id,
verts );
}
@@ -195,6 +196,7 @@ draw_pt_fetch_run_linear(struct pt_fetch *fetch,
translate->run( translate,
start,
count,
+ draw->start_instance,
draw->instance_id,
verts );
}