summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/translate/translate_generic.c
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2013-07-23 01:16:55 -0400
committerZack Rusin <[email protected]>2013-07-25 02:02:36 -0400
commit0e9ec8697353d7a35ea0a2edc63c0c7395f7129e (patch)
tree7a5f04590b5a99ec6e351289b1ce9a92569275dc /src/gallium/auxiliary/translate/translate_generic.c
parent0ac316470813b4f2e825ff4befbbf2135cccce94 (diff)
draw: cleanup and fix instance id computation
The instance id system value always starts at 0, even if the specified start instance is larger than 0. Instead of implicitly setting instance id to instance id plus start instance and then having to subtract instance id when computing the buffer offsets lets just set instance id to the proper instance id. This fixes instance id computation and cleansup buffer offset computation. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/translate/translate_generic.c')
-rw-r--r--src/gallium/auxiliary/translate/translate_generic.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/translate/translate_generic.c b/src/gallium/auxiliary/translate/translate_generic.c
index 96e35b0eb41..fdab0f34a1a 100644
--- a/src/gallium/auxiliary/translate/translate_generic.c
+++ b/src/gallium/auxiliary/translate/translate_generic.c
@@ -625,8 +625,7 @@ static ALWAYS_INLINE void PIPE_CDECL generic_run_one( struct translate_generic *
if (tg->attrib[attr].instance_divisor) {
index = start_instance;
- index += (instance_id - start_instance) /
- tg->attrib[attr].instance_divisor;
+ index += (instance_id / tg->attrib[attr].instance_divisor);
/* XXX we need to clamp the index here too, but to a
* per-array max value, not the draw->pt.max_index value
* that's being given to us via translate->set_buffer().