mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-06 12:15:43 +00:00
The BuiltinPolyfill transform expects the DirectVariableAccess transform to run after it, but this regressed as part of https://dawn-review.googlesource.com/c/dawn/+/122203 Add unit test along with e2e 1926.wgsl test. Bug: tint:1926 Change-Id: I5107453ce152b12e6f2f36930846e1fffa775708 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131020 Reviewed-by: James Price <jrprice@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
34 lines
916 B
HLSL
34 lines
916 B
HLSL
groupshared uint sh_atomic_failed;
|
|
|
|
uint tint_workgroupUniformLoad_sh_atomic_failed() {
|
|
GroupMemoryBarrierWithGroupSync();
|
|
const uint result = sh_atomic_failed;
|
|
GroupMemoryBarrierWithGroupSync();
|
|
return result;
|
|
}
|
|
|
|
RWByteAddressBuffer output : register(u4);
|
|
|
|
struct tint_symbol_1 {
|
|
uint3 local_id : SV_GroupThreadID;
|
|
uint local_invocation_index : SV_GroupIndex;
|
|
uint3 global_id : SV_DispatchThreadID;
|
|
};
|
|
|
|
void main_inner(uint3 global_id, uint3 local_id, uint local_invocation_index) {
|
|
if ((local_invocation_index < 1u)) {
|
|
sh_atomic_failed = 0u;
|
|
}
|
|
GroupMemoryBarrierWithGroupSync();
|
|
const uint failed = tint_workgroupUniformLoad_sh_atomic_failed();
|
|
if ((local_id.x == 0u)) {
|
|
output.Store(0u, asuint(failed));
|
|
}
|
|
}
|
|
|
|
[numthreads(256, 1, 1)]
|
|
void main(tint_symbol_1 tint_symbol) {
|
|
main_inner(tint_symbol.global_id, tint_symbol.local_id, tint_symbol.local_invocation_index);
|
|
return;
|
|
}
|