[llvm] [DirectX] Implement Shader Flag Analysis for `UAVsAtEveryStage`  (PR #137085)
    Deric C. via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Apr 29 10:22:00 PDT 2025
    
    
  
================
@@ -32,6 +32,35 @@
 using namespace llvm;
 using namespace llvm::dxil;
 
+static bool hasUAVsAtEveryStage(DXILResourceMap &DRM,
+                                const ModuleMetadataInfo &MMDI) {
+  if (DRM.uavs().empty())
+    return false;
+
+  switch (MMDI.ShaderProfile) {
+  default:
+    return false;
+  case Triple::EnvironmentType::Compute:
+  case Triple::EnvironmentType::Pixel:
+    return false;
+  case Triple::EnvironmentType::Vertex:
+  case Triple::EnvironmentType::Geometry:
+  case Triple::EnvironmentType::Hull:
+  case Triple::EnvironmentType::Domain:
+    return true;
----------------
Icohedron wrote:
If the version is less than 1.8, they would still get the UAVsAtEveryStage flag because they are not Compute or Pixel
https://github.com/llvm/llvm-project/pull/137085
    
    
More information about the llvm-commits
mailing list