diff options
author | Brian Paul <[email protected]> | 2011-04-19 16:13:43 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-04-19 16:13:47 -0600 |
commit | 8b7f760f835f870b8f6af6c4d6613d44440f1dc5 (patch) | |
tree | 9783e47a97c748a3c4872d15b5d9386b8dacc9c4 /src/gallium/auxiliary/translate/translate_generic.c | |
parent | 08d1c91e6c185a186e49189b7ed48629f35a4659 (diff) |
translate: disable clamping of instanced array indexes
This fixes piglit's draw-instanced-divisor test for softpipe on both
the generic and SSE paths. This is temporary until we have the
correct per-array max_index information.
Diffstat (limited to 'src/gallium/auxiliary/translate/translate_generic.c')
-rw-r--r-- | src/gallium/auxiliary/translate/translate_generic.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/translate/translate_generic.c b/src/gallium/auxiliary/translate/translate_generic.c index ad809db720d..e4e1c868333 100644 --- a/src/gallium/auxiliary/translate/translate_generic.c +++ b/src/gallium/auxiliary/translate/translate_generic.c @@ -381,14 +381,17 @@ static ALWAYS_INLINE void PIPE_CDECL generic_run_one( struct translate_generic * if (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(). + */ } else { index = elt; + /* clamp to avoid going out of bounds */ + index = MIN2(index, tg->attrib[attr].max_index); } - /* clamp to void going out of bounds */ - index = MIN2(index, tg->attrib[attr].max_index); - src = tg->attrib[attr].input_ptr + tg->attrib[attr].input_stride * index; |