From 300b914595f81bdf01d00ffcaad285952bd003ce Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Thu, 25 Apr 2019 11:57:01 +0200 Subject: [PATCH] shader: Create dst with a constant index on GLES and actually use it Fixes: 368d950e8fe861b6e50947f8e4740f169f7a5f2b shader: emulate indirect ssbo write access on GLES using a switch statement Thanks Erik for catching this. Signed-off-by: Gert Wollny Reviewed-by: Erik Faye-Lund --- src/vrend_shader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 2e93fab..e8e6528 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -2759,9 +2759,9 @@ translate_store(struct dump_ctx *ctx, emit_buff(ctx, "switch (addr%d + %d) {\n", inst->Dst[0].Indirect.Index, inst->Dst[0].Register.Index - base); for (int i = 0; i < array_count; ++i) { - snprintf(dst, 128, "%simg%d[addr%d + %d]", cname, basearrayidx, inst->Dst[0].Indirect.Index, inst->Dst[0].Register.Index - basearrayidx); emit_buff(ctx, "case %d:\n", i); - emit_store_mem(ctx, dsts[0], inst->Dst[0].Register.WriteMask, srcs, conversion); + snprintf(dst, 128, "%simg%d[%d]", cname, basearrayidx, i); + emit_store_mem(ctx, dst, inst->Dst[0].Register.WriteMask, srcs, conversion); emit_buff(ctx, "break;\n"); } emit_buf(ctx, "}\n");