blob: af2f5a18301dc360bb36d7039fb276c220773392 (
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
33
34
35
36
37
38
39
40
41
42
43
44
|
// rw-texture.hlsl
//TEST:COMPARE_HLSL: -profile ps_5_0 -entry main
// Ensure that we implement the `Load` operations on
// `RWTexture*` types with the correct signature.
#ifdef __SLANG__
#define R(X) /**/
#define BEGIN_CBUFFER(NAME) cbuffer NAME
#define END_CBUFFER(NAME, REG) /**/
#define CBUFFER_REF(NAME, FIELD) FIELD
#else
#define R(X) : register(X)
#define BEGIN_CBUFFER(NAME) struct SLANG_ParameterGroup_##NAME
#define END_CBUFFER(NAME, REG) ; cbuffer NAME : REG { SLANG_ParameterGroup_##NAME NAME; }
#define CBUFFER_REF(NAME, FIELD) NAME.FIELD
#define C C_0
#define SV_Target SV_TARGET
#define u2 u2_0
#define u3 u3_0
#define t2 t2_0
#define t2a t2a_0
#define t3 t3_0
#endif
BEGIN_CBUFFER(C)
{
uint2 u2;
uint3 u3;
}
END_CBUFFER(C, register(b0))
RWTexture2D<float4> t2 R(u1);
RWTexture2DArray<float4> t2a R(u2);
RWTexture3D<float4> t3 R(u3);
float4 main() : SV_Target
{
return t2.Load(int2(CBUFFER_REF(C,u2)))
+ t2a.Load(int3(CBUFFER_REF(C,u3)))
+ t3.Load(int3(CBUFFER_REF(C,u3)));
}
|