mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-25 07:53:32 +00:00
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>
22 lines
583 B
HLSL
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));
|
|
}
|