From d58243d9041947c99f18b82385e62c082507decb Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Sat, 17 May 2025 02:26:44 +0000 Subject: Support Vulkan memory model (#7057) The user can explicitly use Vulkan memory model, or it will be automatically used when cooperative-matrix is used. When vulkan memory model is used, two keywords, "Coherent" and "Volatile", are not allowed. There are many differences regarding atomic and texture but this PR has changes limited to support `globallycoherent` keyword. When variables with `globallycoherent` is used with `OpLoad`, it will use additional options, `MakePointerAvailable|NonPrivatePointer`, that will provide the same effect. For `OpStore`, it will use `MakePointerVisible|NonPrivatePointer`. --- tests/hlsl/simple/globallycoherent.hlsl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/hlsl') diff --git a/tests/hlsl/simple/globallycoherent.hlsl b/tests/hlsl/simple/globallycoherent.hlsl index 70b5cdb2b..07f0dd57f 100644 --- a/tests/hlsl/simple/globallycoherent.hlsl +++ b/tests/hlsl/simple/globallycoherent.hlsl @@ -1,7 +1,15 @@ //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 -- cgit v1.2.3