yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
d58243d90
master
1//TEST:SIMPLE(filecheck=SPIRV): -target spirv-asm -entry computeMain -stage compute 2//TEST:SIMPLE(filecheck=VK_MEM_MODEL): -target spirv-asm -entry computeMain -stage compute -capability vk_mem_model 3 4//SPIRV: OpDecorate {{.*}} Coherent 5 6//VK_MEM_MODEL-NOT: OpDecorate {{.*}} Coherent 7//VK_MEM_MODEL: OpImageRead %{{.*}} MakeTexelVisible|NonPrivateTexel % 8//VK_MEM_MODEL: OpImageWrite %{{.*}} MakeTexelAvailable|NonPrivateTexel % 9//VK_MEM_MODEL: OpImageRead %{{.*}} MakeTexelVisible|NonPrivateTexel % 10//VK_MEM_MODEL: OpImageWrite %{{.*}} MakeTexelAvailable|NonPrivateTexel % 11 12globallycoherent 13RWTexture2D<int4> outputTexture2D; 14 15[numthreads(1,1,1)] 16void computeMain() 17{ 18 // This line issues kIROp_ImageLoad/Store 19 outputTexture2D[0].xz = outputTexture2D[0].yw; 20 21 // The current implementation uses spirv_asm for subscription, 22 // which goes through a different part of implementation in slang-emit-spirv.cpp. 23 outputTexture2D[uint2(0,0)] = outputTexture2D[uint2(1,1)]; 24}