yum-mirror/slang

Making it easier to work with shaders

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

Jay KwakSupport Vulkan memory model (#7057)d58243d90

master
749 B28 linesraw
1//TEST:COMPARE_HLSL:-profile cs_5_0
2//TEST:SIMPLE(filecheck=SPIRV): -target spirv-asm
3//TEST:SIMPLE(filecheck=VK_MEM_MODEL): -target spirv-asm -emit-spirv-directly -capability vk_mem_model
4
5// Check output for `globallycoherent`
6
7//SPIRV: OpDecorate {{.*}} Coherent
8
9//VK_MEM_MODEL-NOT: OpDecorate {{.*}} Coherent
10//VK_MEM_MODEL: OpLoad {{.*}} MakePointerVisible|NonPrivatePointer
11//VK_MEM_MODEL: OpStore {{.*}} MakePointerAvailable|NonPrivatePointer
12
13#ifndef __SLANG__
14#define gBuffer gBuffer_0
15#define SV_DispatchThreadID SV_DISPATCHTHREADID
16#endif
17
18globallycoherent
19RWStructuredBuffer<uint> gBuffer : register(u0);
20
21[numthreads(16,1,1)]
22void main(
23	uint tid : SV_DispatchThreadID)
24{
25	uint index = tid;
26
27    gBuffer[index] = gBuffer[index + 1];
28}