vrend: Fix atomicCompSwap types

Previously, virgl generated invalid GLSL for atomicCompSwap leading
to compile errors.

Signed-off-by: John Bates <jbates@chromium.org>
Reviewed-by: Lepton Wu <lepton@chromium.org>
macos/master
John Bates 3 years ago
parent a108be89e3
commit 086510d5f4
  1. 3
      src/vrend_shader.c

@ -3527,6 +3527,9 @@ translate_atomic(struct dump_ctx *ctx,
stypeprefix = FLOAT_BITS_TO_UINT;
}
if (is_cas)
snprintf(cas_str, sizeof(cas_str), ", %s(%s(%s))", get_string(type), get_string(stypeprefix), srcs[3]);
emit_buff(&ctx->glsl_strbufs, "%s = %s(atomic%s(%s[int(floatBitsToInt(%s)) >> 2], %s(%s(%s).x)%s));\n",
dst, get_string(dtypeprefix), opname, srcs[0], srcs[1],
get_string(type), get_string(stypeprefix), srcs[2], cas_str);

Loading…
Cancel
Save