dawn-cmake/test/tint/statements/compound_assign/matrix/times-scalar.wgsl.expected.fxc.hlsl
Ben Clayton 1a1b5278d5 tint/transform: Inline HLSL uniform / storage buffers
Change the DecomposeMemoryAccess to behave more like the DirectVariableAccess transform, in that it'll inline the access of buffer variable into the load / store helper functions, instead of passing the array down.

This avoids large array copies observed with FXC, which can have *severe* performance costs.

Fixed: tint:1819
Change-Id: I52eb3f908813f72ab9da446743e24a2637158309
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121460
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-02-24 17:16:55 +00:00

22 lines
583 B
HLSL

[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void v_store(uint offset, float4x4 value) {
v.Store4((offset + 0u), asuint(value[0u]));
v.Store4((offset + 16u), asuint(value[1u]));
v.Store4((offset + 32u), asuint(value[2u]));
v.Store4((offset + 48u), asuint(value[3u]));
}
float4x4 v_load(uint offset) {
return float4x4(asfloat(v.Load4((offset + 0u))), asfloat(v.Load4((offset + 16u))), asfloat(v.Load4((offset + 32u))), asfloat(v.Load4((offset + 48u))));
}
void foo() {
v_store(0u, (v_load(0u) * 2.0f));
}