dawn-cmake/test/bug/tint/827.wgsl.expected.hlsl
Ben Clayton 51b9da45c8 writer/hlsl: Fix level packing for textureLoad()
This was spectacularly broken. Caught by CTS.

Change-Id: Iebf9dd5934be8ef4ec4217d60d5691aee73f5ea3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56501
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-06-30 08:51:36 +00:00

15 lines
502 B
HLSL

static const uint width = 128u;
Texture2D tex : register(t0, space0);
RWByteAddressBuffer result : register(u1, 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;
result.Store((4u * ((GlobalInvocationId.y * width) + GlobalInvocationId.x)), asuint(tex.Load(int3(int(GlobalInvocationId.x), int(GlobalInvocationId.y), 0)).x));
return;
}