shader: Create dst with a constant index on GLES and actually use it

Fixes: 368d950e8f
  shader: emulate indirect ssbo write access on GLES using a switch statement

Thanks Erik for catching this.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
macos/master
Gert Wollny 6 years ago
parent 2e07b3b918
commit 300b914595
  1. 4
      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");

Loading…
Cancel
Save