diff options
| author | Yong He <yonghe@outlook.com> | 2023-08-21 17:07:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-21 17:07:34 -0700 |
| commit | bd6dbaf7c3ea720b4ed39904fe08878f9dcbd947 (patch) | |
| tree | 9e8c436e0888d192c462f75e4655a63b51f41648 /tests/cross-compile | |
| parent | f94b2f7a328a898c5e3dc1389d08e0b7ce6e092e (diff) | |
Compile append and consume structured buffers to glsl. (#3142)
* Compile append and consume structured buffers to glsl.
* Fix.
* Update CI config.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/cross-compile')
| -rw-r--r-- | tests/cross-compile/array-of-buffers.slang.glsl | 19 | ||||
| -rw-r--r-- | tests/cross-compile/func-resource-param-array.slang.glsl | 26 |
2 files changed, 21 insertions, 24 deletions
diff --git a/tests/cross-compile/array-of-buffers.slang.glsl b/tests/cross-compile/array-of-buffers.slang.glsl index a198a5277..fb1a4be2f 100644 --- a/tests/cross-compile/array-of-buffers.slang.glsl +++ b/tests/cross-compile/array-of-buffers.slang.glsl @@ -10,8 +10,7 @@ layout(binding = 0) layout(std140) uniform _S1 { uint index_0; -} C_0; - +}C_0; struct S_0 { vec4 f_0; @@ -21,23 +20,25 @@ layout(binding = 1) layout(std140) uniform _S2 { vec4 f_0; -} cb_0[3]; -layout(std430, binding = 2) readonly buffer _S3 { +}cb_0[3]; +layout(std430, binding = 2) readonly buffer StructuredBuffer_S_t_0 { S_0 _data[]; } sb1_0[4]; -layout(std430, binding = 3) buffer _S4 { +layout(std430, binding = 3) buffer StructuredBuffer_float4_t_0 { vec4 _data[]; } sb2_0[5]; -layout(std430, binding = 4) readonly buffer _S5 +layout(std430, binding = 4) readonly buffer _S3 { uint _data[]; } bb_0[6]; layout(location = 0) -out vec4 _S6; +out vec4 _S4; void main() { - 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)); + + uint _S5 = ((bb_0[C_0.index_0])._data[(int(C_0.index_0 * 4U))/4]); + _S4 = 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(_S5)); return; } + diff --git a/tests/cross-compile/func-resource-param-array.slang.glsl b/tests/cross-compile/func-resource-param-array.slang.glsl index 9e396e55f..0c4c44bef 100644 --- a/tests/cross-compile/func-resource-param-array.slang.glsl +++ b/tests/cross-compile/func-resource-param-array.slang.glsl @@ -1,37 +1,33 @@ #version 450 layout(row_major) uniform; layout(row_major) buffer; - -layout(std430, binding = 0) buffer _S1 { +layout(std430, binding = 0) buffer StructuredBuffer_int_t_0 { int _data[]; } a_0; - -layout(std430, binding = 1) buffer _S2 { +layout(std430, binding = 1) buffer StructuredBuffer_int_t_1 { int _data[]; } b_0[3]; - -layout(std430, binding = 2) buffer _S3 { +layout(std430, binding = 2) buffer StructuredBuffer_int_t_2 { int _data[]; } c_0[4][3]; - -int f_0(uint _S4) +int f_0(uint _S1) { - return a_0._data[_S4]; + return a_0._data[_S1]; } -int f_1(uint _S5, uint _S6) +int f_1(uint _S2, uint _S3) { - return b_0[_S5]._data[_S6]; + return b_0[_S2]._data[_S3]; } -int g_0(uint _S7, uint _S8) +int g_0(uint _S4, uint _S5) { - return b_0[_S7]._data[_S8]; + return b_0[_S4]._data[_S5]; } -int g_1(uint _S9, uint _S10, uint _S11) +int g_1(uint _S6, uint _S7, uint _S8) { - return c_0[_S9][_S10]._data[_S11]; + return c_0[_S6][_S7]._data[_S8]; } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; |
