shader: make translate_store take const char * instead of array

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
macos/master
Erik Faye-Lund 6 years ago
parent 6ea0a7124f
commit e9dd306f07
  1. 11
      src/vrend_shader.c

@ -2869,7 +2869,7 @@ translate_store(struct dump_ctx *ctx,
struct tgsi_full_instruction *inst, struct tgsi_full_instruction *inst,
struct source_info *sinfo, struct source_info *sinfo,
const char *srcs[4], const char *srcs[4],
char dsts[3][255]) const char *dst)
{ {
const struct tgsi_full_dst_register *dst_reg = &inst->Dst[0]; const struct tgsi_full_dst_register *dst_reg = &inst->Dst[0];
@ -2895,8 +2895,9 @@ translate_store(struct dump_ctx *ctx,
break; break;
} }
if (!ctx->cfg->use_gles || !dst_reg->Register.Indirect) { if (!ctx->cfg->use_gles || !dst_reg->Register.Indirect) {
emit_buff(ctx, "imageStore(%s,%s(%s(%s)),%s%s(%s));\n", dsts[0], get_string(coord_prefix), emit_buff(ctx, "imageStore(%s,%s(%s(%s)),%s%s(%s));\n",
conversion, srcs[0], ms_str, get_string(stypeprefix), srcs[1]); dst, get_string(coord_prefix), conversion, srcs[0],
ms_str, get_string(stypeprefix), srcs[1]);
} else { } else {
struct vrend_array *image = lookup_image_array_ptr(ctx, dst_reg->Register.Index); struct vrend_array *image = lookup_image_array_ptr(ctx, dst_reg->Register.Index);
if (image) { if (image) {
@ -2925,7 +2926,7 @@ translate_store(struct dump_ctx *ctx,
const char *conversion = sinfo->override_no_cast[1] ? "" : get_string(dtypeprefix); const char *conversion = sinfo->override_no_cast[1] ? "" : get_string(dtypeprefix);
if (!ctx->cfg->use_gles || !dst_reg->Register.Indirect) { if (!ctx->cfg->use_gles || !dst_reg->Register.Indirect) {
emit_store_mem(ctx, dsts[0], dst_reg->Register.WriteMask, srcs, emit_store_mem(ctx, dst, dst_reg->Register.WriteMask, srcs,
conversion); conversion);
} else { } else {
const char *cname = tgsi_proc_to_prefix(ctx->prog_type); const char *cname = tgsi_proc_to_prefix(ctx->prog_type);
@ -5089,7 +5090,7 @@ iter_instruction(struct tgsi_iterate_context *iter,
return false; return false;
srcs[1] = ctx->src_bufs[1].buf; srcs[1] = ctx->src_bufs[1].buf;
} }
translate_store(ctx, inst, &sinfo, srcs, dsts); translate_store(ctx, inst, &sinfo, srcs, dsts[0]);
break; break;
case TGSI_OPCODE_LOAD: case TGSI_OPCODE_LOAD:
if (ctx->cfg->use_gles) { if (ctx->cfg->use_gles) {

Loading…
Cancel
Save