summaryrefslogtreecommitdiffstats
path: root/tests/cross-compile
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-08-14 16:23:19 -0700
committerGitHub <noreply@github.com>2023-08-14 16:23:19 -0700
commit661d6198bbb9857d3fdc6df477e0742ed0b0765c (patch)
tree974a57cfa2e43624e91502e9e652a0cc78105b3a /tests/cross-compile
parent0403e0556b470f6b316153caea2dc6f5c314da5b (diff)
Support per field matrix layout (#3101)
* Support per field matrix layout * Fix warnings. * Fix. * Fix tests. * Fix spiv gen. * Fix. * More test fixes. * Fix. * Run only GPU tests on self-hosted servers. * Remove -use-glsl-matrix-layout-modifier. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/cross-compile')
-rw-r--r--tests/cross-compile/array-of-buffers.slang.glsl7
-rw-r--r--tests/cross-compile/array-of-buffers.slang.hlsl8
-rw-r--r--tests/cross-compile/func-resource-param-array.slang.glsl13
3 files changed, 12 insertions, 16 deletions
diff --git a/tests/cross-compile/array-of-buffers.slang.glsl b/tests/cross-compile/array-of-buffers.slang.glsl
index 62990033e..a198a5277 100644
--- a/tests/cross-compile/array-of-buffers.slang.glsl
+++ b/tests/cross-compile/array-of-buffers.slang.glsl
@@ -11,6 +11,7 @@ layout(std140) uniform _S1
{
uint index_0;
} C_0;
+
struct S_0
{
vec4 f_0;
@@ -36,9 +37,7 @@ out vec4 _S6;
void main()
{
- S_0 _S7 = ((sb1_0[C_0.index_0])._data[(C_0.index_0)]);
- vec4 _S8 = cb_0[C_0.index_0].f_0 + _S7.f_0;
- uint _S9 = ((bb_0[C_0.index_0])._data[(int(C_0.index_0 * 4U))/4]);
- _S6 = _S8 + ((sb2_0[C_0.index_0])._data[(C_0.index_0)]) + vec4(float(_S9));
+ uint _S7 = ((bb_0[C_0.index_0])._data[(int(C_0.index_0 * 4U))/4]);
+ _S6 = cb_0[C_0.index_0].f_0 + sb1_0[C_0.index_0]._data[C_0.index_0].f_0 + sb2_0[C_0.index_0]._data[C_0.index_0] + vec4(float(_S7));
return;
}
diff --git a/tests/cross-compile/array-of-buffers.slang.hlsl b/tests/cross-compile/array-of-buffers.slang.hlsl
index e709d323a..ca4b76bbe 100644
--- a/tests/cross-compile/array-of-buffers.slang.hlsl
+++ b/tests/cross-compile/array-of-buffers.slang.hlsl
@@ -13,6 +13,7 @@ cbuffer C_0 : register(b0)
{
SLANG_ParameterGroup_C_0 C_0;
}
+
struct S_0
{
float4 f_0;
@@ -25,10 +26,9 @@ StructuredBuffer<S_0 > sb1_0[int(4)] : register(t0);
RWStructuredBuffer<float4 > sb2_0[int(5)] : register(u0);
ByteAddressBuffer bb_0[int(6)] : register(t4);
+
float4 main() : SV_TARGET
{
- S_0 _S1 = sb1_0[C_0.index_0][C_0.index_0];
- float4 _S2 = cb_0[C_0.index_0].f_0 + _S1.f_0;
- uint _S3 = bb_0[C_0.index_0].Load(int(C_0.index_0 * 4U));
- return _S2 + sb2_0[C_0.index_0][C_0.index_0] + (float4)float(_S3);
+ uint _S1 = bb_0[C_0.index_0].Load(int(C_0.index_0 * 4U));
+ return cb_0[C_0.index_0].f_0 + sb1_0[C_0.index_0].Load(C_0.index_0).f_0 + sb2_0[C_0.index_0][C_0.index_0] + (float4)float(_S1);
}
diff --git a/tests/cross-compile/func-resource-param-array.slang.glsl b/tests/cross-compile/func-resource-param-array.slang.glsl
index d5d1bd08c..9e396e55f 100644
--- a/tests/cross-compile/func-resource-param-array.slang.glsl
+++ b/tests/cross-compile/func-resource-param-array.slang.glsl
@@ -16,22 +16,22 @@ layout(std430, binding = 2) buffer _S3 {
int f_0(uint _S4)
{
- return ((a_0)._data[(_S4)]);
+ return a_0._data[_S4];
}
int f_1(uint _S5, uint _S6)
{
- return ((b_0[_S5])._data[(_S6)]);
+ return b_0[_S5]._data[_S6];
}
int g_0(uint _S7, uint _S8)
{
- return ((b_0[_S7])._data[(_S8)]);
+ return b_0[_S7]._data[_S8];
}
int g_1(uint _S9, uint _S10, uint _S11)
{
- return ((c_0[_S9][_S10])._data[(_S11)]);
+ return c_0[_S9][_S10]._data[_S11];
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
@@ -39,10 +39,7 @@ void main()
{
uint ii_0 = gl_GlobalInvocationID.x;
uint jj_0 = gl_GlobalInvocationID.y;
-
- int tmp_0 = f_0(ii_0) + f_0(jj_0) + f_1(ii_0, jj_0) + g_0(ii_0, jj_0) + g_1(ii_0, jj_0, gl_GlobalInvocationID.z);
-
- ((a_0)._data[(ii_0)]) = tmp_0;
+ a_0._data[ii_0] = f_0(ii_0) + f_0(jj_0) + f_1(ii_0, jj_0) + g_0(ii_0, jj_0) + g_1(ii_0, jj_0, gl_GlobalInvocationID.z);
return;
}