yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Tim FoleyRework command-line options handling for entry points and targets (#697)725985528

master
579 B38 linesraw
1//TEST:COMPARE_HLSL: -profile cs_5_0
2
3// Make sure we handle complex UAV write patterns
4
5// Force import of Slang to ensure that some
6// checking takes place:
7#ifdef __SLANG__
8__import empty;
9#else
10
11#define Bar Bar_0
12#define bar bar_0
13#define gUAV gUAV_0
14#define gUAV2 gUAV2_0
15
16#endif
17
18struct Bar
19{
20	uint bar;
21};
22
23RWStructuredBuffer<Bar> gUAV : register(u0);
24
25void foo(RWTexture1D<float2> uav)
26{
27	uint index = gUAV.IncrementCounter();
28	gUAV[index].bar = 1;
29	uav[index] = float2(0,0);
30}
31
32RWTexture1D<float2> gUAV2 : register(u1);
33
34[numthreads(1,1,1)]
35void main()
36{
37	foo(gUAV2);
38}