mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
transform: Don't unroll arrays in DecomposeMemoryAccess
Arrays can be extremely large, and having the load and store functions unroll the elements can make the complier explode. Fixed: chromium:1229233 Change-Id: Ieb5654254e16f5ce724a205d21d954ef9a0cd053 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58382 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@chromium.org> Reviewed-by: David Neto <dneto@google.com> Auto-Submit: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
c33503069c
commit
883fb63e01
@@ -8,14 +8,19 @@ float2x3 tint_symbol_8(ByteAddressBuffer buffer, uint offset) {
|
||||
return float2x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))));
|
||||
}
|
||||
|
||||
float3x2 tint_symbol_10(ByteAddressBuffer buffer, uint offset) {
|
||||
float3x2 tint_symbol_9(ByteAddressBuffer buffer, uint offset) {
|
||||
return float3x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u))));
|
||||
}
|
||||
|
||||
typedef int4 tint_symbol_12_ret[4];
|
||||
tint_symbol_12_ret tint_symbol_12(ByteAddressBuffer buffer, uint offset) {
|
||||
const int4 tint_symbol_13[4] = {asint(buffer.Load4((offset + 0u))), asint(buffer.Load4((offset + 16u))), asint(buffer.Load4((offset + 32u))), asint(buffer.Load4((offset + 48u)))};
|
||||
return tint_symbol_13;
|
||||
typedef int4 tint_symbol_11_ret[4];
|
||||
tint_symbol_11_ret tint_symbol_11(ByteAddressBuffer buffer, uint offset) {
|
||||
int4 arr_1[4] = (int4[4])0;
|
||||
{
|
||||
for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) {
|
||||
arr_1[i_1] = asint(buffer.Load4((offset + (i_1 * 16u))));
|
||||
}
|
||||
}
|
||||
return arr_1;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
@@ -28,7 +33,7 @@ void main(tint_symbol_1 tint_symbol) {
|
||||
const float3 e = asfloat(s.Load3(((176u * idx) + 32u)));
|
||||
const float f = asfloat(s.Load(((176u * idx) + 44u)));
|
||||
const float2x3 g = tint_symbol_8(s, ((176u * idx) + 48u));
|
||||
const float3x2 h = tint_symbol_10(s, ((176u * idx) + 80u));
|
||||
const int4 i[4] = tint_symbol_12(s, ((176u * idx) + 112u));
|
||||
const float3x2 h = tint_symbol_9(s, ((176u * idx) + 80u));
|
||||
const int4 i[4] = tint_symbol_11(s, ((176u * idx) + 112u));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -9,17 +9,19 @@ void tint_symbol_8(RWByteAddressBuffer buffer, uint offset, float2x3 value) {
|
||||
buffer.Store3((offset + 16u), asuint(value[1u]));
|
||||
}
|
||||
|
||||
void tint_symbol_10(RWByteAddressBuffer buffer, uint offset, float3x2 value) {
|
||||
void tint_symbol_9(RWByteAddressBuffer buffer, uint offset, float3x2 value) {
|
||||
buffer.Store2((offset + 0u), asuint(value[0u]));
|
||||
buffer.Store2((offset + 8u), asuint(value[1u]));
|
||||
buffer.Store2((offset + 16u), asuint(value[2u]));
|
||||
}
|
||||
|
||||
void tint_symbol_12(RWByteAddressBuffer buffer, uint offset, int4 value[4]) {
|
||||
buffer.Store4((offset + 0u), asuint(value[0u]));
|
||||
buffer.Store4((offset + 16u), asuint(value[1u]));
|
||||
buffer.Store4((offset + 32u), asuint(value[2u]));
|
||||
buffer.Store4((offset + 48u), asuint(value[3u]));
|
||||
void tint_symbol_11(RWByteAddressBuffer buffer, uint offset, int4 value[4]) {
|
||||
int4 array[4] = value;
|
||||
{
|
||||
for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) {
|
||||
buffer.Store4((offset + (i_1 * 16u)), asuint(array[i_1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
@@ -32,8 +34,8 @@ void main(tint_symbol_1 tint_symbol) {
|
||||
s.Store3(((176u * idx) + 32u), asuint(float3(0.0f, 0.0f, 0.0f)));
|
||||
s.Store(((176u * idx) + 44u), asuint(0.0f));
|
||||
tint_symbol_8(s, ((176u * idx) + 48u), float2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f));
|
||||
tint_symbol_10(s, ((176u * idx) + 80u), float3x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f));
|
||||
tint_symbol_9(s, ((176u * idx) + 80u), float3x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f));
|
||||
const int4 tint_symbol_13[4] = (int4[4])0;
|
||||
tint_symbol_12(s, ((176u * idx) + 112u), tint_symbol_13);
|
||||
tint_symbol_11(s, ((176u * idx) + 112u), tint_symbol_13);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user