tint/spirv: Fix atomicCompareExchangeWeak

We were missing an `UnwrapRef` when generating the return type, and
were generating invalid SPIR-V when the value being stored was a
reference. The auto-generated builtin tests only test with literal
values.

Fixed: tint:1573
Change-Id: If42280b3cc8ad3fba7355d333e02400c6db843fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92144
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
This commit is contained in:
James Price
2022-06-01 00:03:29 +00:00
committed by Dawn LUCI CQ
parent 6ac7c8a7b9
commit 37d92ca244
7 changed files with 134 additions and 1 deletions

View File

@@ -3161,7 +3161,7 @@ bool Builder::GenerateAtomicBuiltin(const sem::Call* call,
return false;
}
auto* value_sem_type = TypeOf(call->Arguments()[2]->Declaration());
auto* value_sem_type = call->Target()->Signature().parameters[2]->Type();
auto value_type = GenerateTypeIfNeeded(value_sem_type);
if (value_type == 0) {