Mesa (master): translate_sse: Use the correct buffer index in this fast path.
Ilia Mirkin
imirkin at kemper.freedesktop.org
Wed Apr 30 00:36:33 UTC 2014
Module: Mesa
Branch: master
Commit: 1c6aa6599efd9b5cca270bef2e53fd7ac5f31647
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1c6aa6599efd9b5cca270bef2e53fd7ac5f31647
Author: Andreas Hartmetz <andreas.hartmetz at kdab.com>
Date: Sun Apr 13 22:29:35 2014 +0200
translate_sse: Use the correct buffer index in this fast path.
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.
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
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 1b698cd..c7c53b3 100644
--- a/src/gallium/auxiliary/translate/translate_sse.c
+++ b/src/gallium/auxiliary/translate/translate_sse.c
@@ -1228,8 +1228,10 @@ static boolean
incr_inputs(struct translate_sse *p, unsigned index_size)
{
if (!index_size && p->nr_buffer_variants == 1) {
+ const unsigned buffer_index = p->buffer_variant[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->buffer_variant[0].instance_divisor == 0) {
x64_rexw(p->func);
More information about the mesa-commit
mailing list