summaryrefslogtreecommitdiffstats
path: root/tests/spirv/coherent-texture.slang
blob: ab1ce260f438293fd5aef1ff5743fe2c1788db04 (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
//TEST:SIMPLE(filecheck=SPIRV): -target spirv-asm -entry computeMain -stage compute
//TEST:SIMPLE(filecheck=VK_MEM_MODEL): -target spirv-asm -entry computeMain -stage compute -capability vk_mem_model

//SPIRV: OpDecorate {{.*}} Coherent

//VK_MEM_MODEL-NOT: OpDecorate {{.*}} Coherent
//VK_MEM_MODEL: OpImageRead %{{.*}} MakeTexelVisible|NonPrivateTexel %
//VK_MEM_MODEL: OpImageWrite %{{.*}} MakeTexelAvailable|NonPrivateTexel %
//VK_MEM_MODEL: OpImageRead %{{.*}} MakeTexelVisible|NonPrivateTexel %
//VK_MEM_MODEL: OpImageWrite %{{.*}} MakeTexelAvailable|NonPrivateTexel %

globallycoherent
RWTexture2D<int4> outputTexture2D;

[numthreads(1,1,1)]
void computeMain()
{
    // This line issues kIROp_ImageLoad/Store
    outputTexture2D[0].xz = outputTexture2D[0].yw;

    // The current implementation uses spirv_asm for subscription,
    // which goes through a different part of implementation in slang-emit-spirv.cpp.
    outputTexture2D[uint2(0,0)] = outputTexture2D[uint2(1,1)];
}