mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-05 11:45:54 +00:00
Overriding the alignment to 1 would cause nested structures to be incorrectly laid out. The fix: Don't override the alignment. All struct layout validation works on the sem offsets, so none of this has to change. Bug: tint:1776 Change-Id: Ic01d45fb2790cd823ed9a55e336860ebdc351aea Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112603 Kokoro: Ben Clayton <bclayton@google.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Commit-Queue: Ben Clayton <bclayton@google.com>
23 lines
398 B
HLSL
23 lines
398 B
HLSL
struct S {
|
|
float4 a;
|
|
int b;
|
|
};
|
|
|
|
RWByteAddressBuffer sb : register(u0, space0);
|
|
|
|
S tint_symbol(RWByteAddressBuffer buffer, uint offset) {
|
|
const S tint_symbol_3 = {asfloat(buffer.Load4((offset + 0u))), asint(buffer.Load((offset + 16u)))};
|
|
return tint_symbol_3;
|
|
}
|
|
|
|
void main_1() {
|
|
const S x_18 = tint_symbol(sb, 32u);
|
|
return;
|
|
}
|
|
|
|
[numthreads(1, 1, 1)]
|
|
void main() {
|
|
main_1();
|
|
return;
|
|
}
|