[Mesa-dev] [PATCH 4/7] translate_sse: Use the correct buffer index in this fast path.

Andreas Hartmetz ahartmetz at gmail.com
Sun Apr 13 13:29:35 PDT 2014


From: Andreas Hartmetz <andreas.hartmetz at kdab.com>

It is possible that there are multiple input buffers but only one is
relevant for translation. Then there will be only a single translation
group, which might need to source data from a buffer index != 0.

Fixes wrong vertex shader inputs as observed while debugging with an
application and driver combination that requires translation of a
vertex attribute in a non-trivial set of attributes and input buffers.
---
 src/gallium/auxiliary/translate/translate_sse.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/translate/translate_sse.c b/src/gallium/auxiliary/translate/translate_sse.c
index 8dd30c4..dace722 100644
--- a/src/gallium/auxiliary/translate/translate_sse.c
+++ b/src/gallium/auxiliary/translate/translate_sse.c
@@ -1235,8 +1235,10 @@ static boolean
 incr_inputs(struct translate_sse *p, unsigned index_size)
 {
    if (!index_size && p->nr_groups == 1) {
+      const unsigned buffer_index = p->group[0].buffer_index;
       struct x86_reg stride =
-         x86_make_disp(p->machine_EDI, get_offset(p, &p->buffer[0].stride));
+         x86_make_disp(p->machine_EDI,
+                       get_offset(p, &p->buffer[buffer_index].stride));
 
       if (p->group[0].instance_divisor == 0) {
          x64_rexw(p->func);
-- 
1.9.1



More information about the mesa-dev mailing list