blob: de87e6d9d64f798dae01330d6e8de145fad66db2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// array-of-buffers.slang
//TEST:CROSS_COMPILE:-target spirv-assembly -entry main -stage fragment
//TEST:CROSS_COMPILE:-target dxil-assembly -entry main -stage fragment -profile sm_6_0
// This test ensures that we cross-compile arrays of structured/constant
// buffers into appropriate GLSL, where these are not first-class types.
//
// Note that this test does *not* currently test the case of passing
// a structured or constant buffer into a subroutine, which requires
// further work.
struct S { float4 f; };
cbuffer C
{
uint index;
}
ConstantBuffer<S> cb [3];
StructuredBuffer<S> sb1[4];
RWStructuredBuffer<float4> sb2[5];
ByteAddressBuffer bb [6];
float4 main() : SV_Target
{
return cb [index] .f
+ sb1[index][index].f
+ sb2[index][index]
+ float4(bb[index].Load(index*4));
}
|