[llvm] [DirectX][NFC] Rename ShaderFlag to Shader_FEATURE_INFO. (PR #82700)
Xiang Li via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 22 17:41:48 PST 2024
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/82700
>From 7c4aa7a26afd00fe24effeae0fde738ef1ef3a07 Mon Sep 17 00:00:00 2001
From: Xiang Li <python3kgae at outlook.com>
Date: Thu, 22 Feb 2024 17:15:32 -0500
Subject: [PATCH 1/3] [DirectX][NFC] Rename ShaderFlag to Shader_FEATURE_INFO.
This is prepare for add ShaderFlag in DXIL.
For #57925
---
llvm/include/llvm/BinaryFormat/DXContainer.h | 2 +-
.../BinaryFormat/DXContainerConstants.def | 74 +++++++++----------
.../include/llvm/ObjectYAML/DXContainerYAML.h | 2 +-
llvm/lib/ObjectYAML/DXContainerYAML.cpp | 6 +-
llvm/lib/Target/DirectX/DXILShaderFlags.cpp | 2 +-
llvm/lib/Target/DirectX/DXILShaderFlags.h | 6 +-
6 files changed, 46 insertions(+), 46 deletions(-)
diff --git a/llvm/include/llvm/BinaryFormat/DXContainer.h b/llvm/include/llvm/BinaryFormat/DXContainer.h
index c3dcd568216b71..fa786af0d9cda1 100644
--- a/llvm/include/llvm/BinaryFormat/DXContainer.h
+++ b/llvm/include/llvm/BinaryFormat/DXContainer.h
@@ -141,7 +141,7 @@ enum class PartType {
#include "DXContainerConstants.def"
};
-#define SHADER_FLAG(Num, Val, Str) Val = 1ull << Num,
+#define SHADER_FEATURE_INFO(Num, Val, Str) Val = 1ull << Num,
enum class FeatureFlags : uint64_t {
#include "DXContainerConstants.def"
};
diff --git a/llvm/include/llvm/BinaryFormat/DXContainerConstants.def b/llvm/include/llvm/BinaryFormat/DXContainerConstants.def
index 87dd0a5cb6ba70..00caefcfd9d03f 100644
--- a/llvm/include/llvm/BinaryFormat/DXContainerConstants.def
+++ b/llvm/include/llvm/BinaryFormat/DXContainerConstants.def
@@ -11,43 +11,43 @@ CONTAINER_PART(PSG1)
#undef CONTAINER_PART
#endif
-#ifdef SHADER_FLAG
-
-SHADER_FLAG(0, Doubles, "Double-precision floating point")
-SHADER_FLAG(1, ComputeShadersPlusRawAndStructuredBuffers, "Raw and Structured buffers")
-SHADER_FLAG(2, UAVsAtEveryStage, "UAVs at every shader stage")
-SHADER_FLAG(3, Max64UAVs, "64 UAV slots")
-SHADER_FLAG(4, MinimumPrecision, "Minimum-precision data types")
-SHADER_FLAG(5, DX11_1_DoubleExtensions, "Double-precision extensions for 11.1")
-SHADER_FLAG(6, DX11_1_ShaderExtensions, "Shader extensions for 11.1")
-SHADER_FLAG(7, LEVEL9ComparisonFiltering, "Comparison filtering for feature level 9")
-SHADER_FLAG(8, TiledResources, "Tiled resources")
-SHADER_FLAG(9, StencilRef, "PS Output Stencil Ref")
-SHADER_FLAG(10, InnerCoverage, "PS Inner Coverage")
-SHADER_FLAG(11, TypedUAVLoadAdditionalFormats, "Typed UAV Load Additional Formats")
-SHADER_FLAG(12, ROVs, "Raster Ordered UAVs")
-SHADER_FLAG(13, ViewportAndRTArrayIndexFromAnyShaderFeedingRasterizer, "SV_RenderTargetArrayIndex or SV_ViewportArrayIndex from any shader feeding rasterizer")
-SHADER_FLAG(14, WaveOps, "Wave level operations")
-SHADER_FLAG(15, Int64Ops, "64-Bit integer")
-SHADER_FLAG(16, ViewID, "View Instancing")
-SHADER_FLAG(17, Barycentrics, "Barycentrics")
-SHADER_FLAG(18, NativeLowPrecision, "Use native low precision")
-SHADER_FLAG(19, ShadingRate, "Shading Rate")
-SHADER_FLAG(20, Raytracing_Tier_1_1, "Raytracing tier 1.1 features")
-SHADER_FLAG(21, SamplerFeedback, "Sampler feedback")
-SHADER_FLAG(22, AtomicInt64OnTypedResource, "64-bit Atomics on Typed Resources")
-SHADER_FLAG(23, AtomicInt64OnGroupShared, "64-bit Atomics on Group Shared")
-SHADER_FLAG(24, DerivativesInMeshAndAmpShaders, "Derivatives in mesh and amplification shaders")
-SHADER_FLAG(25, ResourceDescriptorHeapIndexing, "Resource descriptor heap indexing")
-SHADER_FLAG(26, SamplerDescriptorHeapIndexing, "Sampler descriptor heap indexing")
-SHADER_FLAG(27, RESERVED, "<RESERVED>")
-SHADER_FLAG(28, AtomicInt64OnHeapResource, "64-bit Atomics on Heap Resources")
-SHADER_FLAG(29, AdvancedTextureOps, "Advanced Texture Ops")
-SHADER_FLAG(30, WriteableMSAATextures, "Writeable MSAA Textures")
-
-SHADER_FLAG(31, NextUnusedBit, "Next reserved shader flag bit (not a flag)")
-
-#undef SHADER_FLAG
+#ifdef SHADER_FEATURE_INFO
+
+SHADER_FEATURE_INFO(0, Doubles, "Double-precision floating point")
+SHADER_FEATURE_INFO(1, ComputeShadersPlusRawAndStructuredBuffers, "Raw and Structured buffers")
+SHADER_FEATURE_INFO(2, UAVsAtEveryStage, "UAVs at every shader stage")
+SHADER_FEATURE_INFO(3, Max64UAVs, "64 UAV slots")
+SHADER_FEATURE_INFO(4, MinimumPrecision, "Minimum-precision data types")
+SHADER_FEATURE_INFO(5, DX11_1_DoubleExtensions, "Double-precision extensions for 11.1")
+SHADER_FEATURE_INFO(6, DX11_1_ShaderExtensions, "Shader extensions for 11.1")
+SHADER_FEATURE_INFO(7, LEVEL9ComparisonFiltering, "Comparison filtering for feature level 9")
+SHADER_FEATURE_INFO(8, TiledResources, "Tiled resources")
+SHADER_FEATURE_INFO(9, StencilRef, "PS Output Stencil Ref")
+SHADER_FEATURE_INFO(10, InnerCoverage, "PS Inner Coverage")
+SHADER_FEATURE_INFO(11, TypedUAVLoadAdditionalFormats, "Typed UAV Load Additional Formats")
+SHADER_FEATURE_INFO(12, ROVs, "Raster Ordered UAVs")
+SHADER_FEATURE_INFO(13, ViewportAndRTArrayIndexFromAnyShaderFeedingRasterizer, "SV_RenderTargetArrayIndex or SV_ViewportArrayIndex from any shader feeding rasterizer")
+SHADER_FEATURE_INFO(14, WaveOps, "Wave level operations")
+SHADER_FEATURE_INFO(15, Int64Ops, "64-Bit integer")
+SHADER_FEATURE_INFO(16, ViewID, "View Instancing")
+SHADER_FEATURE_INFO(17, Barycentrics, "Barycentrics")
+SHADER_FEATURE_INFO(18, NativeLowPrecision, "Use native low precision")
+SHADER_FEATURE_INFO(19, ShadingRate, "Shading Rate")
+SHADER_FEATURE_INFO(20, Raytracing_Tier_1_1, "Raytracing tier 1.1 features")
+SHADER_FEATURE_INFO(21, SamplerFeedback, "Sampler feedback")
+SHADER_FEATURE_INFO(22, AtomicInt64OnTypedResource, "64-bit Atomics on Typed Resources")
+SHADER_FEATURE_INFO(23, AtomicInt64OnGroupShared, "64-bit Atomics on Group Shared")
+SHADER_FEATURE_INFO(24, DerivativesInMeshAndAmpShaders, "Derivatives in mesh and amplification shaders")
+SHADER_FEATURE_INFO(25, ResourceDescriptorHeapIndexing, "Resource descriptor heap indexing")
+SHADER_FEATURE_INFO(26, SamplerDescriptorHeapIndexing, "Sampler descriptor heap indexing")
+SHADER_FEATURE_INFO(27, RESERVED, "<RESERVED>")
+SHADER_FEATURE_INFO(28, AtomicInt64OnHeapResource, "64-bit Atomics on Heap Resources")
+SHADER_FEATURE_INFO(29, AdvancedTextureOps, "Advanced Texture Ops")
+SHADER_FEATURE_INFO(30, WriteableMSAATextures, "Writeable MSAA Textures")
+
+SHADER_FEATURE_INFO(31, NextUnusedBit, "Next reserved shader flag bit (not a flag)")
+
+#undef SHADER_FEATURE_INFO
#endif
#ifdef SEMANTIC_KIND
diff --git a/llvm/include/llvm/ObjectYAML/DXContainerYAML.h b/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
index 66a6ac70bbea10..1ad30df36cdbf2 100644
--- a/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
+++ b/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
@@ -56,7 +56,7 @@ struct DXILProgram {
std::optional<std::vector<llvm::yaml::Hex8>> DXIL;
};
-#define SHADER_FLAG(Num, Val, Str) bool Val = false;
+#define SHADER_FEATURE_INFO(Num, Val, Str) bool Val = false;
struct ShaderFlags {
ShaderFlags() = default;
ShaderFlags(uint64_t FlagData);
diff --git a/llvm/lib/ObjectYAML/DXContainerYAML.cpp b/llvm/lib/ObjectYAML/DXContainerYAML.cpp
index 1f03f2c7d39966..1dadcb987f215b 100644
--- a/llvm/lib/ObjectYAML/DXContainerYAML.cpp
+++ b/llvm/lib/ObjectYAML/DXContainerYAML.cpp
@@ -24,14 +24,14 @@ static_assert((uint64_t)dxbc::FeatureFlags::NextUnusedBit <= 1ull << 63,
"Shader flag bits exceed enum size.");
DXContainerYAML::ShaderFlags::ShaderFlags(uint64_t FlagData) {
-#define SHADER_FLAG(Num, Val, Str) \
+#define SHADER_FEATURE_INFO(Num, Val, Str) \
Val = (FlagData & (uint64_t)dxbc::FeatureFlags::Val) > 0;
#include "llvm/BinaryFormat/DXContainerConstants.def"
}
uint64_t DXContainerYAML::ShaderFlags::getEncodedFlags() {
uint64_t Flag = 0;
-#define SHADER_FLAG(Num, Val, Str) \
+#define SHADER_FEATURE_INFO(Num, Val, Str) \
if (Val) \
Flag |= (uint64_t)dxbc::FeatureFlags::Val;
#include "llvm/BinaryFormat/DXContainerConstants.def"
@@ -105,7 +105,7 @@ void MappingTraits<DXContainerYAML::DXILProgram>::mapping(
void MappingTraits<DXContainerYAML::ShaderFlags>::mapping(
IO &IO, DXContainerYAML::ShaderFlags &Flags) {
-#define SHADER_FLAG(Num, Val, Str) IO.mapRequired(#Val, Flags.Val);
+#define SHADER_FEATURE_INFO(Num, Val, Str) IO.mapRequired(#Val, Flags.Val);
#include "llvm/BinaryFormat/DXContainerConstants.def"
}
diff --git a/llvm/lib/Target/DirectX/DXILShaderFlags.cpp b/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
index bbb56435660211..73606dcef1c874 100644
--- a/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
+++ b/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
@@ -51,7 +51,7 @@ void ComputedShaderFlags::print(raw_ostream &OS) const {
if (FlagVal == 0)
return;
OS << "; Note: shader requires additional functionality:\n";
-#define SHADER_FLAG(bit, FlagName, Str) \
+#define SHADER_FEATURE_INFO(bit, FlagName, Str) \
if (FlagName) \
OS << "; " Str "\n";
#include "llvm/BinaryFormat/DXContainerConstants.def"
diff --git a/llvm/lib/Target/DirectX/DXILShaderFlags.h b/llvm/lib/Target/DirectX/DXILShaderFlags.h
index 4f51873a2d0b34..40931be1c51561 100644
--- a/llvm/lib/Target/DirectX/DXILShaderFlags.h
+++ b/llvm/lib/Target/DirectX/DXILShaderFlags.h
@@ -29,17 +29,17 @@ class GlobalVariable;
namespace dxil {
struct ComputedShaderFlags {
-#define SHADER_FLAG(bit, FlagName, Str) bool FlagName : 1;
+#define SHADER_FEATURE_INFO(bit, FlagName, Str) bool FlagName : 1;
#include "llvm/BinaryFormat/DXContainerConstants.def"
-#define SHADER_FLAG(bit, FlagName, Str) FlagName = false;
+#define SHADER_FEATURE_INFO(bit, FlagName, Str) FlagName = false;
ComputedShaderFlags() {
#include "llvm/BinaryFormat/DXContainerConstants.def"
}
operator uint64_t() const {
uint64_t FlagValue = 0;
-#define SHADER_FLAG(bit, FlagName, Str) \
+#define SHADER_FEATURE_INFO(bit, FlagName, Str) \
FlagValue |= \
FlagName ? static_cast<uint64_t>(dxbc::FeatureFlags::FlagName) : 0ull;
#include "llvm/BinaryFormat/DXContainerConstants.def"
>From 469cd7b4dae2582056e0e62cb90df61e0798d6bc Mon Sep 17 00:00:00 2001
From: Xiang Li <python3kgae at outlook.com>
Date: Thu, 22 Feb 2024 17:28:53 -0500
Subject: [PATCH 2/3] Fix format.
---
llvm/lib/ObjectYAML/DXContainerYAML.cpp | 4 ++--
llvm/lib/Target/DirectX/DXILShaderFlags.cpp | 2 +-
llvm/lib/Target/DirectX/DXILShaderFlags.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/llvm/lib/ObjectYAML/DXContainerYAML.cpp b/llvm/lib/ObjectYAML/DXContainerYAML.cpp
index 1dadcb987f215b..494f93095251e4 100644
--- a/llvm/lib/ObjectYAML/DXContainerYAML.cpp
+++ b/llvm/lib/ObjectYAML/DXContainerYAML.cpp
@@ -24,14 +24,14 @@ static_assert((uint64_t)dxbc::FeatureFlags::NextUnusedBit <= 1ull << 63,
"Shader flag bits exceed enum size.");
DXContainerYAML::ShaderFlags::ShaderFlags(uint64_t FlagData) {
-#define SHADER_FEATURE_INFO(Num, Val, Str) \
+#define SHADER_FEATURE_INFO(Num, Val, Str) \
Val = (FlagData & (uint64_t)dxbc::FeatureFlags::Val) > 0;
#include "llvm/BinaryFormat/DXContainerConstants.def"
}
uint64_t DXContainerYAML::ShaderFlags::getEncodedFlags() {
uint64_t Flag = 0;
-#define SHADER_FEATURE_INFO(Num, Val, Str) \
+#define SHADER_FEATURE_INFO(Num, Val, Str) \
if (Val) \
Flag |= (uint64_t)dxbc::FeatureFlags::Val;
#include "llvm/BinaryFormat/DXContainerConstants.def"
diff --git a/llvm/lib/Target/DirectX/DXILShaderFlags.cpp b/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
index 73606dcef1c874..824647072ec643 100644
--- a/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
+++ b/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
@@ -51,7 +51,7 @@ void ComputedShaderFlags::print(raw_ostream &OS) const {
if (FlagVal == 0)
return;
OS << "; Note: shader requires additional functionality:\n";
-#define SHADER_FEATURE_INFO(bit, FlagName, Str) \
+#define SHADER_FEATURE_INFO(bit, FlagName, Str) \
if (FlagName) \
OS << "; " Str "\n";
#include "llvm/BinaryFormat/DXContainerConstants.def"
diff --git a/llvm/lib/Target/DirectX/DXILShaderFlags.h b/llvm/lib/Target/DirectX/DXILShaderFlags.h
index 40931be1c51561..7a9a1bc29eb481 100644
--- a/llvm/lib/Target/DirectX/DXILShaderFlags.h
+++ b/llvm/lib/Target/DirectX/DXILShaderFlags.h
@@ -39,7 +39,7 @@ struct ComputedShaderFlags {
operator uint64_t() const {
uint64_t FlagValue = 0;
-#define SHADER_FEATURE_INFO(bit, FlagName, Str) \
+#define SHADER_FEATURE_INFO(bit, FlagName, Str) \
FlagValue |= \
FlagName ? static_cast<uint64_t>(dxbc::FeatureFlags::FlagName) : 0ull;
#include "llvm/BinaryFormat/DXContainerConstants.def"
>From c61d196741fbed46b899cf1c44436618adb35621 Mon Sep 17 00:00:00 2001
From: Xiang Li <python3kgae at outlook.com>
Date: Thu, 22 Feb 2024 20:41:32 -0500
Subject: [PATCH 3/3] Rename to Shader feature flag.
---
llvm/include/llvm/BinaryFormat/DXContainer.h | 2 +-
.../BinaryFormat/DXContainerConstants.def | 74 +++++++++----------
.../include/llvm/ObjectYAML/DXContainerYAML.h | 2 +-
llvm/lib/ObjectYAML/DXContainerYAML.cpp | 6 +-
llvm/lib/Target/DirectX/DXILShaderFlags.cpp | 2 +-
llvm/lib/Target/DirectX/DXILShaderFlags.h | 6 +-
6 files changed, 46 insertions(+), 46 deletions(-)
diff --git a/llvm/include/llvm/BinaryFormat/DXContainer.h b/llvm/include/llvm/BinaryFormat/DXContainer.h
index fa786af0d9cda1..a28e19edb4c6a6 100644
--- a/llvm/include/llvm/BinaryFormat/DXContainer.h
+++ b/llvm/include/llvm/BinaryFormat/DXContainer.h
@@ -141,7 +141,7 @@ enum class PartType {
#include "DXContainerConstants.def"
};
-#define SHADER_FEATURE_INFO(Num, Val, Str) Val = 1ull << Num,
+#define SHADER_FEATURE_FLAG(Num, Val, Str) Val = 1ull << Num,
enum class FeatureFlags : uint64_t {
#include "DXContainerConstants.def"
};
diff --git a/llvm/include/llvm/BinaryFormat/DXContainerConstants.def b/llvm/include/llvm/BinaryFormat/DXContainerConstants.def
index 00caefcfd9d03f..80ed86bc3a499e 100644
--- a/llvm/include/llvm/BinaryFormat/DXContainerConstants.def
+++ b/llvm/include/llvm/BinaryFormat/DXContainerConstants.def
@@ -11,43 +11,43 @@ CONTAINER_PART(PSG1)
#undef CONTAINER_PART
#endif
-#ifdef SHADER_FEATURE_INFO
-
-SHADER_FEATURE_INFO(0, Doubles, "Double-precision floating point")
-SHADER_FEATURE_INFO(1, ComputeShadersPlusRawAndStructuredBuffers, "Raw and Structured buffers")
-SHADER_FEATURE_INFO(2, UAVsAtEveryStage, "UAVs at every shader stage")
-SHADER_FEATURE_INFO(3, Max64UAVs, "64 UAV slots")
-SHADER_FEATURE_INFO(4, MinimumPrecision, "Minimum-precision data types")
-SHADER_FEATURE_INFO(5, DX11_1_DoubleExtensions, "Double-precision extensions for 11.1")
-SHADER_FEATURE_INFO(6, DX11_1_ShaderExtensions, "Shader extensions for 11.1")
-SHADER_FEATURE_INFO(7, LEVEL9ComparisonFiltering, "Comparison filtering for feature level 9")
-SHADER_FEATURE_INFO(8, TiledResources, "Tiled resources")
-SHADER_FEATURE_INFO(9, StencilRef, "PS Output Stencil Ref")
-SHADER_FEATURE_INFO(10, InnerCoverage, "PS Inner Coverage")
-SHADER_FEATURE_INFO(11, TypedUAVLoadAdditionalFormats, "Typed UAV Load Additional Formats")
-SHADER_FEATURE_INFO(12, ROVs, "Raster Ordered UAVs")
-SHADER_FEATURE_INFO(13, ViewportAndRTArrayIndexFromAnyShaderFeedingRasterizer, "SV_RenderTargetArrayIndex or SV_ViewportArrayIndex from any shader feeding rasterizer")
-SHADER_FEATURE_INFO(14, WaveOps, "Wave level operations")
-SHADER_FEATURE_INFO(15, Int64Ops, "64-Bit integer")
-SHADER_FEATURE_INFO(16, ViewID, "View Instancing")
-SHADER_FEATURE_INFO(17, Barycentrics, "Barycentrics")
-SHADER_FEATURE_INFO(18, NativeLowPrecision, "Use native low precision")
-SHADER_FEATURE_INFO(19, ShadingRate, "Shading Rate")
-SHADER_FEATURE_INFO(20, Raytracing_Tier_1_1, "Raytracing tier 1.1 features")
-SHADER_FEATURE_INFO(21, SamplerFeedback, "Sampler feedback")
-SHADER_FEATURE_INFO(22, AtomicInt64OnTypedResource, "64-bit Atomics on Typed Resources")
-SHADER_FEATURE_INFO(23, AtomicInt64OnGroupShared, "64-bit Atomics on Group Shared")
-SHADER_FEATURE_INFO(24, DerivativesInMeshAndAmpShaders, "Derivatives in mesh and amplification shaders")
-SHADER_FEATURE_INFO(25, ResourceDescriptorHeapIndexing, "Resource descriptor heap indexing")
-SHADER_FEATURE_INFO(26, SamplerDescriptorHeapIndexing, "Sampler descriptor heap indexing")
-SHADER_FEATURE_INFO(27, RESERVED, "<RESERVED>")
-SHADER_FEATURE_INFO(28, AtomicInt64OnHeapResource, "64-bit Atomics on Heap Resources")
-SHADER_FEATURE_INFO(29, AdvancedTextureOps, "Advanced Texture Ops")
-SHADER_FEATURE_INFO(30, WriteableMSAATextures, "Writeable MSAA Textures")
-
-SHADER_FEATURE_INFO(31, NextUnusedBit, "Next reserved shader flag bit (not a flag)")
-
-#undef SHADER_FEATURE_INFO
+#ifdef SHADER_FEATURE_FLAG
+
+SHADER_FEATURE_FLAG(0, Doubles, "Double-precision floating point")
+SHADER_FEATURE_FLAG(1, ComputeShadersPlusRawAndStructuredBuffers, "Raw and Structured buffers")
+SHADER_FEATURE_FLAG(2, UAVsAtEveryStage, "UAVs at every shader stage")
+SHADER_FEATURE_FLAG(3, Max64UAVs, "64 UAV slots")
+SHADER_FEATURE_FLAG(4, MinimumPrecision, "Minimum-precision data types")
+SHADER_FEATURE_FLAG(5, DX11_1_DoubleExtensions, "Double-precision extensions for 11.1")
+SHADER_FEATURE_FLAG(6, DX11_1_ShaderExtensions, "Shader extensions for 11.1")
+SHADER_FEATURE_FLAG(7, LEVEL9ComparisonFiltering, "Comparison filtering for feature level 9")
+SHADER_FEATURE_FLAG(8, TiledResources, "Tiled resources")
+SHADER_FEATURE_FLAG(9, StencilRef, "PS Output Stencil Ref")
+SHADER_FEATURE_FLAG(10, InnerCoverage, "PS Inner Coverage")
+SHADER_FEATURE_FLAG(11, TypedUAVLoadAdditionalFormats, "Typed UAV Load Additional Formats")
+SHADER_FEATURE_FLAG(12, ROVs, "Raster Ordered UAVs")
+SHADER_FEATURE_FLAG(13, ViewportAndRTArrayIndexFromAnyShaderFeedingRasterizer, "SV_RenderTargetArrayIndex or SV_ViewportArrayIndex from any shader feeding rasterizer")
+SHADER_FEATURE_FLAG(14, WaveOps, "Wave level operations")
+SHADER_FEATURE_FLAG(15, Int64Ops, "64-Bit integer")
+SHADER_FEATURE_FLAG(16, ViewID, "View Instancing")
+SHADER_FEATURE_FLAG(17, Barycentrics, "Barycentrics")
+SHADER_FEATURE_FLAG(18, NativeLowPrecision, "Use native low precision")
+SHADER_FEATURE_FLAG(19, ShadingRate, "Shading Rate")
+SHADER_FEATURE_FLAG(20, Raytracing_Tier_1_1, "Raytracing tier 1.1 features")
+SHADER_FEATURE_FLAG(21, SamplerFeedback, "Sampler feedback")
+SHADER_FEATURE_FLAG(22, AtomicInt64OnTypedResource, "64-bit Atomics on Typed Resources")
+SHADER_FEATURE_FLAG(23, AtomicInt64OnGroupShared, "64-bit Atomics on Group Shared")
+SHADER_FEATURE_FLAG(24, DerivativesInMeshAndAmpShaders, "Derivatives in mesh and amplification shaders")
+SHADER_FEATURE_FLAG(25, ResourceDescriptorHeapIndexing, "Resource descriptor heap indexing")
+SHADER_FEATURE_FLAG(26, SamplerDescriptorHeapIndexing, "Sampler descriptor heap indexing")
+SHADER_FEATURE_FLAG(27, RESERVED, "<RESERVED>")
+SHADER_FEATURE_FLAG(28, AtomicInt64OnHeapResource, "64-bit Atomics on Heap Resources")
+SHADER_FEATURE_FLAG(29, AdvancedTextureOps, "Advanced Texture Ops")
+SHADER_FEATURE_FLAG(30, WriteableMSAATextures, "Writeable MSAA Textures")
+
+SHADER_FEATURE_FLAG(31, NextUnusedBit, "Next reserved shader flag bit (not a flag)")
+
+#undef SHADER_FEATURE_FLAG
#endif
#ifdef SEMANTIC_KIND
diff --git a/llvm/include/llvm/ObjectYAML/DXContainerYAML.h b/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
index 1ad30df36cdbf2..5e8c894a0f4052 100644
--- a/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
+++ b/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
@@ -56,7 +56,7 @@ struct DXILProgram {
std::optional<std::vector<llvm::yaml::Hex8>> DXIL;
};
-#define SHADER_FEATURE_INFO(Num, Val, Str) bool Val = false;
+#define SHADER_FEATURE_FLAG(Num, Val, Str) bool Val = false;
struct ShaderFlags {
ShaderFlags() = default;
ShaderFlags(uint64_t FlagData);
diff --git a/llvm/lib/ObjectYAML/DXContainerYAML.cpp b/llvm/lib/ObjectYAML/DXContainerYAML.cpp
index 494f93095251e4..2804adb1dd919a 100644
--- a/llvm/lib/ObjectYAML/DXContainerYAML.cpp
+++ b/llvm/lib/ObjectYAML/DXContainerYAML.cpp
@@ -24,14 +24,14 @@ static_assert((uint64_t)dxbc::FeatureFlags::NextUnusedBit <= 1ull << 63,
"Shader flag bits exceed enum size.");
DXContainerYAML::ShaderFlags::ShaderFlags(uint64_t FlagData) {
-#define SHADER_FEATURE_INFO(Num, Val, Str) \
+#define SHADER_FEATURE_FLAG(Num, Val, Str) \
Val = (FlagData & (uint64_t)dxbc::FeatureFlags::Val) > 0;
#include "llvm/BinaryFormat/DXContainerConstants.def"
}
uint64_t DXContainerYAML::ShaderFlags::getEncodedFlags() {
uint64_t Flag = 0;
-#define SHADER_FEATURE_INFO(Num, Val, Str) \
+#define SHADER_FEATURE_FLAG(Num, Val, Str) \
if (Val) \
Flag |= (uint64_t)dxbc::FeatureFlags::Val;
#include "llvm/BinaryFormat/DXContainerConstants.def"
@@ -105,7 +105,7 @@ void MappingTraits<DXContainerYAML::DXILProgram>::mapping(
void MappingTraits<DXContainerYAML::ShaderFlags>::mapping(
IO &IO, DXContainerYAML::ShaderFlags &Flags) {
-#define SHADER_FEATURE_INFO(Num, Val, Str) IO.mapRequired(#Val, Flags.Val);
+#define SHADER_FEATURE_FLAG(Num, Val, Str) IO.mapRequired(#Val, Flags.Val);
#include "llvm/BinaryFormat/DXContainerConstants.def"
}
diff --git a/llvm/lib/Target/DirectX/DXILShaderFlags.cpp b/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
index 824647072ec643..66a9dc46bcbfbf 100644
--- a/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
+++ b/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
@@ -51,7 +51,7 @@ void ComputedShaderFlags::print(raw_ostream &OS) const {
if (FlagVal == 0)
return;
OS << "; Note: shader requires additional functionality:\n";
-#define SHADER_FEATURE_INFO(bit, FlagName, Str) \
+#define SHADER_FEATURE_FLAG(bit, FlagName, Str) \
if (FlagName) \
OS << "; " Str "\n";
#include "llvm/BinaryFormat/DXContainerConstants.def"
diff --git a/llvm/lib/Target/DirectX/DXILShaderFlags.h b/llvm/lib/Target/DirectX/DXILShaderFlags.h
index 7a9a1bc29eb481..574a7b090f5281 100644
--- a/llvm/lib/Target/DirectX/DXILShaderFlags.h
+++ b/llvm/lib/Target/DirectX/DXILShaderFlags.h
@@ -29,17 +29,17 @@ class GlobalVariable;
namespace dxil {
struct ComputedShaderFlags {
-#define SHADER_FEATURE_INFO(bit, FlagName, Str) bool FlagName : 1;
+#define SHADER_FEATURE_FLAG(bit, FlagName, Str) bool FlagName : 1;
#include "llvm/BinaryFormat/DXContainerConstants.def"
-#define SHADER_FEATURE_INFO(bit, FlagName, Str) FlagName = false;
+#define SHADER_FEATURE_FLAG(bit, FlagName, Str) FlagName = false;
ComputedShaderFlags() {
#include "llvm/BinaryFormat/DXContainerConstants.def"
}
operator uint64_t() const {
uint64_t FlagValue = 0;
-#define SHADER_FEATURE_INFO(bit, FlagName, Str) \
+#define SHADER_FEATURE_FLAG(bit, FlagName, Str) \
FlagValue |= \
FlagName ? static_cast<uint64_t>(dxbc::FeatureFlags::FlagName) : 0ull;
#include "llvm/BinaryFormat/DXContainerConstants.def"
More information about the llvm-commits
mailing list