Issue 242027
Summary [HLSL][SPIR-V] Decide how clang-dxc chooses the SPIR-V extensions to enable
Labels new issue
Assignees dnovillo
Reporter dnovillo
    #239374 makes `clang-dxc -spirv` default to DXC's extension set instead of all extensions. We recently discussed this problem at the HLSL WG (https://github.com/llvm/wg-hlsl/pull/521) and agreed to have this as an interim approach. However, a long term solution should not rely on a fixed list.

The longer-term question is how and which extensions to enable. Some initial ideas to explore:

- Derive them from the target environment, SPIR-V version or shader model.
- Enable an extension only when the module uses it.
- Keep `-fspv-extension` as the explicit override.
- Take them from a Vulkan profile, such as `VP_KHR_roadmap_2024`.
- Treat extensions as target features of the `spirv` triple, as other targets do with `-mcpu`.
- Diagnose in the frontend when code needs an extension that is not enabled, as Slang does.

Note that enabling everything and pruning by environment or version would not fix this on its own: the extensions in #237364 are optional at every Vulkan version. Pruning also needs a profile or a use-only-when-needed rule.

This supersedes my request in #237364. That allowed me to fix the immediate problem only.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to