mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 23:11:01 +01:00
There is no literal suffix in HLSL for the integer type. We can, however, wrap integer literals in a constructor style cast. This avoids ambiguity when passing literals to overloaded functions, which we'll make use of in the subsequent patch in this PR.
22 lines
594 B
HLSL
22 lines
594 B
HLSL
static const uint SIZE = 128u;
|
|
|
|
groupshared int arr_i32_[128];
|
|
|
|
[numthreads(4, 1, 1)]
|
|
void test_workgroupUniformLoad(uint3 workgroup_id : SV_GroupID, uint3 __local_invocation_id : SV_GroupThreadID)
|
|
{
|
|
if (all(__local_invocation_id == uint3(0u, 0u, 0u))) {
|
|
arr_i32_ = (int[128])0;
|
|
}
|
|
GroupMemoryBarrierWithGroupSync();
|
|
GroupMemoryBarrierWithGroupSync();
|
|
int _e4 = arr_i32_[min(uint(workgroup_id.x), 127u)];
|
|
GroupMemoryBarrierWithGroupSync();
|
|
if ((_e4 > int(10))) {
|
|
GroupMemoryBarrierWithGroupSync();
|
|
return;
|
|
} else {
|
|
return;
|
|
}
|
|
}
|