mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 00:17:03 +00:00
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>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
7052cb57ff
commit
1a1b5278d5
@@ -8,20 +8,20 @@ int i() {
|
||||
return counter;
|
||||
}
|
||||
|
||||
float4x3 tint_symbol_1(uint4 buffer[16], uint offset) {
|
||||
float4x3 a_load_1(uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz));
|
||||
return float4x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz), asfloat(a[scalar_offset_3 / 4].xyz));
|
||||
}
|
||||
|
||||
typedef float4x3 tint_symbol_ret[4];
|
||||
tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
typedef float4x3 a_load_ret[4];
|
||||
a_load_ret a_load(uint offset) {
|
||||
float4x3 arr[4] = (float4x3[4])0;
|
||||
{
|
||||
for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) {
|
||||
arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 64u)));
|
||||
arr[i_1] = a_load_1((offset + (i_1 * 64u)));
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
@@ -31,8 +31,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
void f() {
|
||||
const int p_a_i_save = i();
|
||||
const int p_a_i_i_save = i();
|
||||
const float4x3 l_a[4] = tint_symbol(a, 0u);
|
||||
const float4x3 l_a_i = tint_symbol_1(a, (64u * uint(p_a_i_save)));
|
||||
const float4x3 l_a[4] = a_load(0u);
|
||||
const float4x3 l_a_i = a_load_1((64u * uint(p_a_i_save)));
|
||||
const uint scalar_offset_4 = (((64u * uint(p_a_i_save)) + (16u * uint(p_a_i_i_save)))) / 4;
|
||||
const float3 l_a_i_i = asfloat(a[scalar_offset_4 / 4].xyz);
|
||||
return;
|
||||
|
||||
@@ -8,20 +8,20 @@ int i() {
|
||||
return counter;
|
||||
}
|
||||
|
||||
float4x3 tint_symbol_1(uint4 buffer[16], uint offset) {
|
||||
float4x3 a_load_1(uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz));
|
||||
return float4x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz), asfloat(a[scalar_offset_3 / 4].xyz));
|
||||
}
|
||||
|
||||
typedef float4x3 tint_symbol_ret[4];
|
||||
tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
typedef float4x3 a_load_ret[4];
|
||||
a_load_ret a_load(uint offset) {
|
||||
float4x3 arr[4] = (float4x3[4])0;
|
||||
{
|
||||
for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) {
|
||||
arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 64u)));
|
||||
arr[i_1] = a_load_1((offset + (i_1 * 64u)));
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
@@ -31,8 +31,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
void f() {
|
||||
const int p_a_i_save = i();
|
||||
const int p_a_i_i_save = i();
|
||||
const float4x3 l_a[4] = tint_symbol(a, 0u);
|
||||
const float4x3 l_a_i = tint_symbol_1(a, (64u * uint(p_a_i_save)));
|
||||
const float4x3 l_a[4] = a_load(0u);
|
||||
const float4x3 l_a_i = a_load_1((64u * uint(p_a_i_save)));
|
||||
const uint scalar_offset_4 = (((64u * uint(p_a_i_save)) + (16u * uint(p_a_i_i_save)))) / 4;
|
||||
const float3 l_a_i_i = asfloat(a[scalar_offset_4 / 4].xyz);
|
||||
return;
|
||||
|
||||
@@ -2,20 +2,20 @@ cbuffer cbuffer_a : register(b0, space0) {
|
||||
uint4 a[16];
|
||||
};
|
||||
|
||||
float4x3 tint_symbol_1(uint4 buffer[16], uint offset) {
|
||||
float4x3 a_load_1(uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz));
|
||||
return float4x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz), asfloat(a[scalar_offset_3 / 4].xyz));
|
||||
}
|
||||
|
||||
typedef float4x3 tint_symbol_ret[4];
|
||||
tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
typedef float4x3 a_load_ret[4];
|
||||
a_load_ret a_load(uint offset) {
|
||||
float4x3 arr[4] = (float4x3[4])0;
|
||||
{
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
arr[i] = tint_symbol_1(buffer, (offset + (i * 64u)));
|
||||
arr[i] = a_load_1((offset + (i * 64u)));
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
@@ -23,8 +23,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void f() {
|
||||
const float4x3 l_a[4] = tint_symbol(a, 0u);
|
||||
const float4x3 l_a_i = tint_symbol_1(a, 128u);
|
||||
const float4x3 l_a[4] = a_load(0u);
|
||||
const float4x3 l_a_i = a_load_1(128u);
|
||||
const float3 l_a_i_i = asfloat(a[9].xyz);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2,20 +2,20 @@ cbuffer cbuffer_a : register(b0, space0) {
|
||||
uint4 a[16];
|
||||
};
|
||||
|
||||
float4x3 tint_symbol_1(uint4 buffer[16], uint offset) {
|
||||
float4x3 a_load_1(uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz));
|
||||
return float4x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz), asfloat(a[scalar_offset_3 / 4].xyz));
|
||||
}
|
||||
|
||||
typedef float4x3 tint_symbol_ret[4];
|
||||
tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
typedef float4x3 a_load_ret[4];
|
||||
a_load_ret a_load(uint offset) {
|
||||
float4x3 arr[4] = (float4x3[4])0;
|
||||
{
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
arr[i] = tint_symbol_1(buffer, (offset + (i * 64u)));
|
||||
arr[i] = a_load_1((offset + (i * 64u)));
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
@@ -23,8 +23,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void f() {
|
||||
const float4x3 l_a[4] = tint_symbol(a, 0u);
|
||||
const float4x3 l_a_i = tint_symbol_1(a, 128u);
|
||||
const float4x3 l_a[4] = a_load(0u);
|
||||
const float4x3 l_a_i = a_load_1(128u);
|
||||
const float3 l_a_i_i = asfloat(a[9].xyz);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) {
|
||||
uint4 u[16];
|
||||
};
|
||||
|
||||
float4x3 tint_symbol(uint4 buffer[16], uint offset) {
|
||||
float4x3 u_load(uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz));
|
||||
return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void f() {
|
||||
const float3x4 t = transpose(tint_symbol(u, 128u));
|
||||
const float3x4 t = transpose(u_load(128u));
|
||||
const float l = length(asfloat(u[1].xyz).zxy);
|
||||
const float a = abs(asfloat(u[1].xyz).zxy.x);
|
||||
return;
|
||||
|
||||
@@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) {
|
||||
uint4 u[16];
|
||||
};
|
||||
|
||||
float4x3 tint_symbol(uint4 buffer[16], uint offset) {
|
||||
float4x3 u_load(uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz));
|
||||
return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void f() {
|
||||
const float3x4 t = transpose(tint_symbol(u, 128u));
|
||||
const float3x4 t = transpose(u_load(128u));
|
||||
const float l = length(asfloat(u[1].xyz).zxy);
|
||||
const float a = abs(asfloat(u[1].xyz).zxy.x);
|
||||
return;
|
||||
|
||||
@@ -14,20 +14,20 @@ void c(float3 v) {
|
||||
void d(float f_1) {
|
||||
}
|
||||
|
||||
float4x3 tint_symbol_1(uint4 buffer[16], uint offset) {
|
||||
float4x3 u_load_1(uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz));
|
||||
return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz));
|
||||
}
|
||||
|
||||
typedef float4x3 tint_symbol_ret[4];
|
||||
tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
typedef float4x3 u_load_ret[4];
|
||||
u_load_ret u_load(uint offset) {
|
||||
float4x3 arr[4] = (float4x3[4])0;
|
||||
{
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
arr[i] = tint_symbol_1(buffer, (offset + (i * 64u)));
|
||||
arr[i] = u_load_1((offset + (i * 64u)));
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
@@ -35,8 +35,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void f() {
|
||||
a(tint_symbol(u, 0u));
|
||||
b(tint_symbol_1(u, 64u));
|
||||
a(u_load(0u));
|
||||
b(u_load_1(64u));
|
||||
c(asfloat(u[4].xyz).zxy);
|
||||
d(asfloat(u[4].xyz).zxy.x);
|
||||
return;
|
||||
|
||||
@@ -14,20 +14,20 @@ void c(float3 v) {
|
||||
void d(float f_1) {
|
||||
}
|
||||
|
||||
float4x3 tint_symbol_1(uint4 buffer[16], uint offset) {
|
||||
float4x3 u_load_1(uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz));
|
||||
return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz));
|
||||
}
|
||||
|
||||
typedef float4x3 tint_symbol_ret[4];
|
||||
tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
typedef float4x3 u_load_ret[4];
|
||||
u_load_ret u_load(uint offset) {
|
||||
float4x3 arr[4] = (float4x3[4])0;
|
||||
{
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
arr[i] = tint_symbol_1(buffer, (offset + (i * 64u)));
|
||||
arr[i] = u_load_1((offset + (i * 64u)));
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
@@ -35,8 +35,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void f() {
|
||||
a(tint_symbol(u, 0u));
|
||||
b(tint_symbol_1(u, 64u));
|
||||
a(u_load(0u));
|
||||
b(u_load_1(64u));
|
||||
c(asfloat(u[4].xyz).zxy);
|
||||
d(asfloat(u[4].xyz).zxy.x);
|
||||
return;
|
||||
|
||||
@@ -3,20 +3,20 @@ cbuffer cbuffer_u : register(b0, space0) {
|
||||
};
|
||||
static float4x3 p[4] = (float4x3[4])0;
|
||||
|
||||
float4x3 tint_symbol_1(uint4 buffer[16], uint offset) {
|
||||
float4x3 u_load_1(uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz));
|
||||
return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz));
|
||||
}
|
||||
|
||||
typedef float4x3 tint_symbol_ret[4];
|
||||
tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
typedef float4x3 u_load_ret[4];
|
||||
u_load_ret u_load(uint offset) {
|
||||
float4x3 arr[4] = (float4x3[4])0;
|
||||
{
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
arr[i] = tint_symbol_1(buffer, (offset + (i * 64u)));
|
||||
arr[i] = u_load_1((offset + (i * 64u)));
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
@@ -24,8 +24,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void f() {
|
||||
p = tint_symbol(u, 0u);
|
||||
p[1] = tint_symbol_1(u, 128u);
|
||||
p = u_load(0u);
|
||||
p[1] = u_load_1(128u);
|
||||
p[1][0] = asfloat(u[1].xyz).zxy;
|
||||
p[1][0].x = asfloat(u[1].x);
|
||||
return;
|
||||
|
||||
@@ -3,20 +3,20 @@ cbuffer cbuffer_u : register(b0, space0) {
|
||||
};
|
||||
static float4x3 p[4] = (float4x3[4])0;
|
||||
|
||||
float4x3 tint_symbol_1(uint4 buffer[16], uint offset) {
|
||||
float4x3 u_load_1(uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz));
|
||||
return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz));
|
||||
}
|
||||
|
||||
typedef float4x3 tint_symbol_ret[4];
|
||||
tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
typedef float4x3 u_load_ret[4];
|
||||
u_load_ret u_load(uint offset) {
|
||||
float4x3 arr[4] = (float4x3[4])0;
|
||||
{
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
arr[i] = tint_symbol_1(buffer, (offset + (i * 64u)));
|
||||
arr[i] = u_load_1((offset + (i * 64u)));
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
@@ -24,8 +24,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) {
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void f() {
|
||||
p = tint_symbol(u, 0u);
|
||||
p[1] = tint_symbol_1(u, 128u);
|
||||
p = u_load(0u);
|
||||
p[1] = u_load_1(128u);
|
||||
p[1][0] = asfloat(u[1].xyz).zxy;
|
||||
p[1][0].x = asfloat(u[1].x);
|
||||
return;
|
||||
|
||||
@@ -3,36 +3,36 @@ cbuffer cbuffer_u : register(b0, space0) {
|
||||
};
|
||||
RWByteAddressBuffer s : register(u1, space0);
|
||||
|
||||
void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float4x3 value) {
|
||||
buffer.Store3((offset + 0u), asuint(value[0u]));
|
||||
buffer.Store3((offset + 16u), asuint(value[1u]));
|
||||
buffer.Store3((offset + 32u), asuint(value[2u]));
|
||||
buffer.Store3((offset + 48u), asuint(value[3u]));
|
||||
void s_store_1(uint offset, float4x3 value) {
|
||||
s.Store3((offset + 0u), asuint(value[0u]));
|
||||
s.Store3((offset + 16u), asuint(value[1u]));
|
||||
s.Store3((offset + 32u), asuint(value[2u]));
|
||||
s.Store3((offset + 48u), asuint(value[3u]));
|
||||
}
|
||||
|
||||
void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x3 value[4]) {
|
||||
void s_store(uint offset, float4x3 value[4]) {
|
||||
float4x3 array_1[4] = value;
|
||||
{
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
tint_symbol_1(buffer, (offset + (i * 64u)), array_1[i]);
|
||||
s_store_1((offset + (i * 64u)), array_1[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float4x3 tint_symbol_4(uint4 buffer[16], uint offset) {
|
||||
float4x3 u_load_1(uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz));
|
||||
return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz));
|
||||
}
|
||||
|
||||
typedef float4x3 tint_symbol_3_ret[4];
|
||||
tint_symbol_3_ret tint_symbol_3(uint4 buffer[16], uint offset) {
|
||||
typedef float4x3 u_load_ret[4];
|
||||
u_load_ret u_load(uint offset) {
|
||||
float4x3 arr[4] = (float4x3[4])0;
|
||||
{
|
||||
for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) {
|
||||
arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 64u)));
|
||||
arr[i_1] = u_load_1((offset + (i_1 * 64u)));
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
@@ -40,8 +40,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[16], uint offset) {
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void f() {
|
||||
tint_symbol(s, 0u, tint_symbol_3(u, 0u));
|
||||
tint_symbol_1(s, 64u, tint_symbol_4(u, 128u));
|
||||
s_store(0u, u_load(0u));
|
||||
s_store_1(64u, u_load_1(128u));
|
||||
s.Store3(64u, asuint(asfloat(u[1].xyz).zxy));
|
||||
s.Store(64u, asuint(asfloat(u[1].x)));
|
||||
return;
|
||||
|
||||
@@ -3,36 +3,36 @@ cbuffer cbuffer_u : register(b0, space0) {
|
||||
};
|
||||
RWByteAddressBuffer s : register(u1, space0);
|
||||
|
||||
void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float4x3 value) {
|
||||
buffer.Store3((offset + 0u), asuint(value[0u]));
|
||||
buffer.Store3((offset + 16u), asuint(value[1u]));
|
||||
buffer.Store3((offset + 32u), asuint(value[2u]));
|
||||
buffer.Store3((offset + 48u), asuint(value[3u]));
|
||||
void s_store_1(uint offset, float4x3 value) {
|
||||
s.Store3((offset + 0u), asuint(value[0u]));
|
||||
s.Store3((offset + 16u), asuint(value[1u]));
|
||||
s.Store3((offset + 32u), asuint(value[2u]));
|
||||
s.Store3((offset + 48u), asuint(value[3u]));
|
||||
}
|
||||
|
||||
void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x3 value[4]) {
|
||||
void s_store(uint offset, float4x3 value[4]) {
|
||||
float4x3 array_1[4] = value;
|
||||
{
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
tint_symbol_1(buffer, (offset + (i * 64u)), array_1[i]);
|
||||
s_store_1((offset + (i * 64u)), array_1[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float4x3 tint_symbol_4(uint4 buffer[16], uint offset) {
|
||||
float4x3 u_load_1(uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz));
|
||||
return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz));
|
||||
}
|
||||
|
||||
typedef float4x3 tint_symbol_3_ret[4];
|
||||
tint_symbol_3_ret tint_symbol_3(uint4 buffer[16], uint offset) {
|
||||
typedef float4x3 u_load_ret[4];
|
||||
u_load_ret u_load(uint offset) {
|
||||
float4x3 arr[4] = (float4x3[4])0;
|
||||
{
|
||||
for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) {
|
||||
arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 64u)));
|
||||
arr[i_1] = u_load_1((offset + (i_1 * 64u)));
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
@@ -40,8 +40,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[16], uint offset) {
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void f() {
|
||||
tint_symbol(s, 0u, tint_symbol_3(u, 0u));
|
||||
tint_symbol_1(s, 64u, tint_symbol_4(u, 128u));
|
||||
s_store(0u, u_load(0u));
|
||||
s_store_1(64u, u_load_1(128u));
|
||||
s.Store3(64u, asuint(asfloat(u[1].xyz).zxy));
|
||||
s.Store(64u, asuint(asfloat(u[1].x)));
|
||||
return;
|
||||
|
||||
@@ -7,20 +7,20 @@ struct tint_symbol_1 {
|
||||
uint local_invocation_index : SV_GroupIndex;
|
||||
};
|
||||
|
||||
float4x3 tint_symbol_3(uint4 buffer[16], uint offset) {
|
||||
float4x3 u_load_1(uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz));
|
||||
return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz));
|
||||
}
|
||||
|
||||
typedef float4x3 tint_symbol_2_ret[4];
|
||||
tint_symbol_2_ret tint_symbol_2(uint4 buffer[16], uint offset) {
|
||||
typedef float4x3 u_load_ret[4];
|
||||
u_load_ret u_load(uint offset) {
|
||||
float4x3 arr[4] = (float4x3[4])0;
|
||||
{
|
||||
for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) {
|
||||
arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 64u)));
|
||||
arr[i_1] = u_load_1((offset + (i_1 * 64u)));
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
@@ -34,8 +34,8 @@ void f_inner(uint local_invocation_index) {
|
||||
}
|
||||
}
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
w = tint_symbol_2(u, 0u);
|
||||
w[1] = tint_symbol_3(u, 128u);
|
||||
w = u_load(0u);
|
||||
w[1] = u_load_1(128u);
|
||||
w[1][0] = asfloat(u[1].xyz).zxy;
|
||||
w[1][0].x = asfloat(u[1].x);
|
||||
}
|
||||
|
||||
@@ -7,20 +7,20 @@ struct tint_symbol_1 {
|
||||
uint local_invocation_index : SV_GroupIndex;
|
||||
};
|
||||
|
||||
float4x3 tint_symbol_3(uint4 buffer[16], uint offset) {
|
||||
float4x3 u_load_1(uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz));
|
||||
return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz));
|
||||
}
|
||||
|
||||
typedef float4x3 tint_symbol_2_ret[4];
|
||||
tint_symbol_2_ret tint_symbol_2(uint4 buffer[16], uint offset) {
|
||||
typedef float4x3 u_load_ret[4];
|
||||
u_load_ret u_load(uint offset) {
|
||||
float4x3 arr[4] = (float4x3[4])0;
|
||||
{
|
||||
for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) {
|
||||
arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 64u)));
|
||||
arr[i_1] = u_load_1((offset + (i_1 * 64u)));
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
@@ -34,8 +34,8 @@ void f_inner(uint local_invocation_index) {
|
||||
}
|
||||
}
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
w = tint_symbol_2(u, 0u);
|
||||
w[1] = tint_symbol_3(u, 128u);
|
||||
w = u_load(0u);
|
||||
w[1] = u_load_1(128u);
|
||||
w[1][0] = asfloat(u[1].xyz).zxy;
|
||||
w[1][0].x = asfloat(u[1].x);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user