You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Make DXC emit VulkanMemoryModel instead of Logical GLSL450 #5784
Is your feature request related to a problem? Please describe.
We would like to take advantage of the Vulkan Memory Model, for consistency and sanity reasons.
Describe the solution you'd like
A compilation flag that would enable the Vulkan memory model
Describe alternatives you've considered
Use GLSL450 but we'd like to be able to reason about the memory ordering of our operations.
There is also the flag -0config=--upgrade-memory-model but this would require writing operations in glsl450 and rely on spirv-opt to upgrade them, whereas we'd like to use the proper VMM opcodes which are not necessarily expressible in glsl450.
Thanks for submitting this issue! This feature isn't likely to be prioritized in the near future, however, if you are able to provide any examples of HLSL that is sub-optimally expressed when going through OpMemoryModel Logical GLSL450->--upgrade-memory-model that would be helpful to better understand your use case.
The problem is that we can't use VMM (like atomics, OpLoad and OpStore with acquire/release operands) while DXC still emits GLSL450 for all the rest of the code
devshgraphicsprogramming commented on Apr 16, 2024
The problem is that we can't use VMM (like atomics, OpLoad and OpStore with acquire/release operands) while DXC still emits GLSL450 for all the rest of the code
and still we can't use acquire/release etc on atomics
fatal error: generated SPIR-V is invalid: VulkanMemoryModelKHR capability must only be specified if the VulkanKHR memory model is used.
OpMemoryModel Logical GLSL450
Activity
sudonatalie commentedon Oct 17, 2023
Thanks for submitting this issue! This feature isn't likely to be prioritized in the near future, however, if you are able to provide any examples of HLSL that is sub-optimally expressed when going through
OpMemoryModel Logical GLSL450->--upgrade-memory-modelthat would be helpful to better understand your use case.devshgraphicsprogramming commentedon Feb 3, 2024
The problem is that we can't use VMM (like atomics, OpLoad and OpStore with acquire/release operands) while DXC still emits GLSL450 for all the rest of the code
devshgraphicsprogramming commentedon Apr 16, 2024
Natalie Chouinard (@sudonatalie) I have an example! (with BDA and prop 0011 syntax)
https://godbolt.org/z/a9sx4ss68
and still we can't use acquire/release etc on atomics
sudonatalie commentedon Apr 16, 2024
Thanks for the additional info Mateusz Kielan (@devshgraphicsprogramming). We'll keep this on our radar but it's unlikely to be a near future priority.
devshgraphicsprogramming commentedon Apr 17, 2024
Actually turned out I didn't need this to declare my
OpLoadfor BDA was missing a[[vk::ext_literal]]on the intrinsic declaration[SPIRV] Add vulkan memory option to DXC
[SPIRV] Add vulkan memory option to DXC (microsoft#6848)
[SPIRV] Add vulkan memory option to DXC (microsoft#6848)