mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-04 19:25:47 +00:00
And fix issues where global variables would not be emitted unless they were transitively referenced by an entry point. This change requires crbug.com/tint/697 to be fixed before landing. Change-Id: I712bd9d369e08c9a3cdfb0f114c3609584f91f28 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54241 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: James Price <jrprice@google.com>
42 lines
1.2 KiB
HLSL
42 lines
1.2 KiB
HLSL
bug/tint/757.wgsl:3:5 warning: use of deprecated language feature: [[offset]] has been replaced with [[size]] and [[align]]
|
|
[[offset(0)]] level : i32;
|
|
^^^^^^
|
|
|
|
bug/tint/757.wgsl:10:5 warning: use of deprecated language feature: [[offset]] has been replaced with [[size]] and [[align]]
|
|
[[offset(0)]] values : [[stride(4)]] array<f32>;
|
|
^^^^^^
|
|
|
|
struct Constants {
|
|
int level;
|
|
};
|
|
|
|
ConstantBuffer<Constants> constants : register(b0, space0);
|
|
Texture2DArray<float4> myTexture : register(t1, space0);
|
|
|
|
RWByteAddressBuffer result : register(u3, space0);
|
|
|
|
struct tint_symbol_1 {
|
|
uint3 GlobalInvocationID : SV_DispatchThreadID;
|
|
};
|
|
|
|
[numthreads(1, 1, 1)]
|
|
void main(tint_symbol_1 tint_symbol) {
|
|
const uint3 GlobalInvocationID = tint_symbol.GlobalInvocationID;
|
|
uint flatIndex = ((((2u * 2u) * GlobalInvocationID.z) + (2u * GlobalInvocationID.y)) + GlobalInvocationID.x);
|
|
flatIndex = (flatIndex * 1u);
|
|
float4 texel = myTexture.Load(int4(GlobalInvocationID.xy, 0, 0), 0);
|
|
{
|
|
uint i = 0u;
|
|
while (true) {
|
|
if (!((i < 1u))) {
|
|
break;
|
|
}
|
|
result.Store((4u * (flatIndex + i)), asuint(texel.r));
|
|
{
|
|
i = (i + 1u);
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|