Skip to content

[Feature Request] Make DXC emit VulkanMemoryModel instead of Logical GLSL450 #5784

Closed

Description

@kpentaris

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.

Additional context
N/A

Activity

  1. added
    enhancement
    needs-triage
    on Sep 26, 2023
  2. added
    spirv
    on Sep 26, 2023
  3. sudonatalie commented on Oct 17, 2023

    @sudonatalie
    Collaborator

    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.

  4. moved this from For Google to Done in HLSL Triageon Oct 17, 2023
  5. devshgraphicsprogramming commented on Feb 3, 2024

    @devshgraphicsprogramming

    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

  6. devshgraphicsprogramming commented on Apr 16, 2024

    @devshgraphicsprogramming

    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

    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

    fatal error: generated SPIR-V is invalid: VulkanMemoryModelKHR capability must only be specified if the VulkanKHR memory model is used.
      OpMemoryModel Logical GLSL450
    
  7. sudonatalie commented on Apr 16, 2024

    @sudonatalie
    Collaborator

    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.

  8. devshgraphicsprogramming commented on Apr 17, 2024

    @devshgraphicsprogramming

    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.

    Actually turned out I didn't need this to declare my OpLoad for BDA was missing a [[vk::ext_literal]] on the intrinsic declaration

  9. added a commit that references this issue on Aug 6, 2024
    0905473
  10. added a commit that references this issue on Aug 8, 2024
    06da989
  11. added a commit that references this issue on Jul 24, 2025
    f586fbd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementspirv

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions