summaryrefslogtreecommitdiffstats
path: root/tests/hlsl/simple/globallycoherent.hlsl
blob: 07f0dd57f730c0058fefd2b0f1afda783c0e9af7 (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
//TEST:COMPARE_HLSL:-profile cs_5_0
//TEST:SIMPLE(filecheck=SPIRV): -target spirv-asm
//TEST:SIMPLE(filecheck=VK_MEM_MODEL): -target spirv-asm -emit-spirv-directly -capability vk_mem_model

// Check output for `globallycoherent`

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

//VK_MEM_MODEL-NOT: OpDecorate {{.*}} Coherent
//VK_MEM_MODEL: OpLoad {{.*}} MakePointerVisible|NonPrivatePointer
//VK_MEM_MODEL: OpStore {{.*}} MakePointerAvailable|NonPrivatePointer

#ifndef __SLANG__
#define gBuffer gBuffer_0
#define SV_DispatchThreadID SV_DISPATCHTHREADID
#endif

globallycoherent
RWStructuredBuffer<uint> gBuffer : register(u0);

[numthreads(16,1,1)]
void main(
	uint tid : SV_DispatchThreadID)
{
	uint index = tid;

    gBuffer[index] = gBuffer[index + 1];
}