[all-commits] [llvm/llvm-project] 80fa62: [DirectX] Set shader feature flags MinimumPrecisio...

Deric C. via All-commits all-commits at lists.llvm.org
Wed May 14 10:37:48 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 80fa6214821582511c687d00a484929530df1661
      https://github.com/llvm/llvm-project/commit/80fa6214821582511c687d00a484929530df1661
  Author: Deric C. <cheung.deric at gmail.com>
  Date:   2025-05-14 (Wed, 14 May 2025)

  Changed paths:
    M llvm/include/llvm/BinaryFormat/DXContainerConstants.def
    M llvm/lib/Target/DirectX/DXILShaderFlags.cpp
    M llvm/lib/Target/DirectX/DXILShaderFlags.h
    M llvm/test/CodeGen/DirectX/ShaderFlags/low-precision.ll
    M llvm/test/CodeGen/DirectX/ShaderFlags/res-may-not-alias-sm6.7.ll
    M llvm/test/CodeGen/DirectX/ShaderFlags/use-native-low-precision-0.ll
    M llvm/test/CodeGen/DirectX/ShaderFlags/use-native-low-precision-1.ll

  Log Message:
  -----------
  [DirectX] Set shader feature flags MinimumPrecision and NativeLowPrecision, and refactor the logic for setting low-precision-related flags (#139623)

Fixes #138997 and does refactoring for low-precision-related flags.

The shader feature flags MinimumPrecision and NativeLowPrecision were
not being set, leading to validation errors.
This PR sets these shader feature flags [as in
DXC](https://github.com/microsoft/DirectXShaderCompiler/blob/377c4ca6d82adb83bf2eaf978a7040443848d6fd/lib/DXIL/DxilShaderFlags.cpp#L58-L63)
and adds tests for them.

This PR also performs some refactoring of low-precision-related flags to
make it less confusing.
- The `UseNativeLowPrecision` DXIL module flag has been renamed to
`NativeLowPrecisionMode` to imply that it is setting some execution
state which the module should be interpreted with
- The LLVM module flag `dx.nativelowprec` is now read only once and sets
a bool to be used by `updateFunctionFlags()` and for setting the DXIL
module flag `NativeLowPrecisionMode`
- The `MinimumPrecision`, `NativeLowPrecision`, and
`LowPrecisionPresent` shader feature flags are all set together under
`updateFunctionFlags()`
- Moved the logic for setting DXIL module flags `NativeLowPrecisionMode`
and `ResMayNotAlias` out of the per-function loop and placed it
alongside the logic for setting other DXIL module flags
(`DisableOptimizations`, `Max64UAVs`, and `UAVsAtEveryStage` flags)

---------

Co-authored-by: Justin Bogner <mail at justinbogner.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list