[virglrenderer-devel] [PATCH 3/7] shader: add image support to shader parsing.

Dave Airlie airlied at gmail.com
Fri Jul 20 01:37:09 UTC 2018


>
>     opname = get_atomic_opname(inst->Instruction.Opcode, &is_cas);
>     if (!opname)
> @@ -2307,6 +2456,15 @@ translate_atomic(struct dump_ctx *ctx,
>     if (is_cas)
>        snprintf(cas_str, 64, ", %s(%s(%s))", get_string(stypecast), get_string(stypeprefix), srcs[3]);
>
> +   if (src->Register.File == TGSI_FILE_IMAGE) {
> +      bool is_ms = false;
> +      enum vrend_type_qualifier coord_prefix = get_coord_prefix(ctx->images[sinfo->sreg_index].decl.Resource, &is_ms);
> +      char ms_str[32] = {};
> +      if (is_ms) {
> +         snprintf(ms_str, 32, ", int(%s.w)", srcs[1]);
> +      }
> +      snprintf(buf, 512, "%s = %s(imageAtomic%s(%s, %s(floatBitsToInt(%s))%s, %s(%s(%s))%s));\n", dsts[0], get_string(dtypeprefix), opname, srcs[0], get_string(coord_prefix), srcs[1], ms_str, get_string(stypecast), get_string(stypeprefix), srcs[2], cas_str);

There's a missing EMIT_BUF_WITH_RET here. Fixed locally.

Dave.


More information about the virglrenderer-devel mailing list