[llvm] [DirectX] add enum for PSV resource type/kind/flag. (PR #106227)

Xiang Li via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 08:36:08 PDT 2024


https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/106227

>From a4dffe2aa760c5594adaed974b4f92d44d29b318 Mon Sep 17 00:00:00 2001
From: Xiang Li <python3kgae at outlook.com>
Date: Tue, 27 Aug 2024 09:56:26 -0400
Subject: [PATCH 1/2] [DirectX] add enum for PSV resource type/kind/flag.

Add ResourceType, ResourceKind and ResourceFlag enum class for PSV resource.

This is for #103275
---
 llvm/include/llvm/BinaryFormat/DXContainer.h  | 27 +++++++-
 .../BinaryFormat/DXContainerConstants.def     | 46 +++++++++++++
 .../include/llvm/ObjectYAML/DXContainerYAML.h |  3 +
 llvm/lib/BinaryFormat/DXContainer.cpp         | 31 +++++++++
 llvm/lib/ObjectYAML/DXContainerYAML.cpp       | 18 ++++++
 .../DXContainer/DomainMaskVectors.yaml        |  6 +-
 .../DXContainer/PSVv0-amplification.yaml      |  8 +--
 .../ObjectYAML/DXContainer/PSVv0-compute.yaml |  8 +--
 .../ObjectYAML/DXContainer/PSVv0-domain.yaml  |  8 +--
 .../DXContainer/PSVv0-geometry.yaml           |  8 +--
 .../ObjectYAML/DXContainer/PSVv0-hull.yaml    |  8 +--
 .../ObjectYAML/DXContainer/PSVv0-mesh.yaml    |  8 +--
 .../ObjectYAML/DXContainer/PSVv0-pixel.yaml   |  8 +--
 .../ObjectYAML/DXContainer/PSVv0-vertex.yaml  |  8 +--
 .../DXContainer/PSVv1-amplification.yaml      |  8 +--
 .../ObjectYAML/DXContainer/PSVv1-compute.yaml |  8 +--
 .../ObjectYAML/DXContainer/PSVv1-domain.yaml  |  8 +--
 .../DXContainer/PSVv1-geometry.yaml           |  8 +--
 .../ObjectYAML/DXContainer/PSVv1-hull.yaml    |  8 +--
 .../ObjectYAML/DXContainer/PSVv1-mesh.yaml    |  8 +--
 .../ObjectYAML/DXContainer/PSVv1-pixel.yaml   |  8 +--
 .../ObjectYAML/DXContainer/PSVv1-vertex.yaml  |  8 +--
 .../DXContainer/PSVv2-amplification.yaml      | 24 +++----
 .../ObjectYAML/DXContainer/PSVv2-compute.yaml | 24 +++----
 .../ObjectYAML/DXContainer/PSVv2-domain.yaml  | 24 +++----
 .../DXContainer/PSVv2-geometry.yaml           | 24 +++----
 .../ObjectYAML/DXContainer/PSVv2-hull.yaml    | 24 +++----
 .../ObjectYAML/DXContainer/PSVv2-mesh.yaml    | 24 +++----
 .../ObjectYAML/DXContainer/PSVv2-pixel.yaml   | 24 +++----
 .../ObjectYAML/DXContainer/PSVv2-vertex.yaml  | 24 +++----
 .../DXContainer/PSVv3-amplification.yaml      | 24 +++----
 .../ObjectYAML/DXContainer/PSVv3-compute.yaml | 24 +++----
 .../ObjectYAML/DXContainer/PSVv3-domain.yaml  | 24 +++----
 .../DXContainer/PSVv3-geometry.yaml           | 24 +++----
 .../ObjectYAML/DXContainer/PSVv3-hull.yaml    | 24 +++----
 .../ObjectYAML/DXContainer/PSVv3-mesh.yaml    | 24 +++----
 .../ObjectYAML/DXContainer/PSVv3-pixel.yaml   | 24 +++----
 .../ObjectYAML/DXContainer/PSVv3-vertex.yaml  | 24 +++----
 .../ObjectYAML/DXContainer/SigElements.yaml   |  4 +-
 llvm/unittests/Object/DXContainerTest.cpp     | 64 +++++++++----------
 40 files changed, 415 insertions(+), 296 deletions(-)

diff --git a/llvm/include/llvm/BinaryFormat/DXContainer.h b/llvm/include/llvm/BinaryFormat/DXContainer.h
index 013431faff2728..d0e8fab219d5e8 100644
--- a/llvm/include/llvm/BinaryFormat/DXContainer.h
+++ b/llvm/include/llvm/BinaryFormat/DXContainer.h
@@ -299,6 +299,27 @@ enum class InterpolationMode : uint8_t {
 
 ArrayRef<EnumEntry<InterpolationMode>> getInterpolationModes();
 
+#define RESOURCE_TYPE(Val, Enum) Enum = Val,
+enum class ResourceType : uint32_t {
+#include "DXContainerConstants.def"
+};
+
+ArrayRef<EnumEntry<ResourceType>> getResourceTypes();
+
+#define RESOURCE_KIND(Val, Enum) Enum = Val,
+enum class ResourceKind : uint32_t {
+#include "DXContainerConstants.def"
+};
+
+ArrayRef<EnumEntry<ResourceKind>> getResourceKinds();
+
+#define RESOURCE_FLAG(Val, Enum) Enum = Val,
+enum class ResourceFlag : uint32_t {
+#include "DXContainerConstants.def"
+};
+
+ArrayRef<EnumEntry<ResourceFlag>> getResourceFlags();
+
 namespace v0 {
 struct RuntimeInfo {
   PipelinePSVInfo StageInfo;
@@ -315,7 +336,7 @@ struct RuntimeInfo {
 };
 
 struct ResourceBindInfo {
-  uint32_t Type;
+  ResourceType Type;
   uint32_t Space;
   uint32_t LowerBound;
   uint32_t UpperBound;
@@ -417,8 +438,8 @@ struct RuntimeInfo : public v1::RuntimeInfo {
 };
 
 struct ResourceBindInfo : public v0::ResourceBindInfo {
-  uint32_t Kind;
-  uint32_t Flags;
+  ResourceKind Kind;
+  ResourceFlag Flags;
 
   void swapBytes() {
     v0::ResourceBindInfo::swapBytes();
diff --git a/llvm/include/llvm/BinaryFormat/DXContainerConstants.def b/llvm/include/llvm/BinaryFormat/DXContainerConstants.def
index 62dc573555198b..4111cecb018bb3 100644
--- a/llvm/include/llvm/BinaryFormat/DXContainerConstants.def
+++ b/llvm/include/llvm/BinaryFormat/DXContainerConstants.def
@@ -150,6 +150,52 @@ INTERPOLATION_MODE(8, Invalid)
 #undef INTERPOLATION_MODE
 #endif // INTERPOLATION_MODE
 
+#ifdef RESOURCE_TYPE
+RESOURCE_TYPE(0, Invalid)
+RESOURCE_TYPE(1, Sampler)
+RESOURCE_TYPE(2, CBV)
+RESOURCE_TYPE(3, SRVTyped)
+RESOURCE_TYPE(4, SRVRaw)
+RESOURCE_TYPE(5, SRVStructured)
+RESOURCE_TYPE(6, UAVTyped)
+RESOURCE_TYPE(7, UAVRaw)
+RESOURCE_TYPE(8, UAVStructured)
+RESOURCE_TYPE(9, UAVStructuredWithCounter)
+
+#undef RESOURCE_TYPE
+#endif // RESOURCE_TYPE
+
+#ifdef RESOURCE_KIND
+RESOURCE_KIND(0, Invalid)
+RESOURCE_KIND(1, Texture1D)
+RESOURCE_KIND(2, Texture2D)
+RESOURCE_KIND(3, Texture2DMS)
+RESOURCE_KIND(4, Texture3D)
+RESOURCE_KIND(5, TextureCube)
+RESOURCE_KIND(6, Texture1DArray)
+RESOURCE_KIND(7, Texture2DArray)
+RESOURCE_KIND(8, Texture2DMSArray)
+RESOURCE_KIND(9, TextureCubeArray)
+RESOURCE_KIND(10, TypedBuffer)
+RESOURCE_KIND(11, RawBuffer)
+RESOURCE_KIND(12, StructuredBuffer)
+RESOURCE_KIND(13, CBuffer)
+RESOURCE_KIND(14, Sampler)
+RESOURCE_KIND(15, TBuffer)
+RESOURCE_KIND(16, RTAccelerationStructure)
+RESOURCE_KIND(17, FeedbackTexture2D)
+RESOURCE_KIND(18, FeedbackTexture2DArray)
+
+#undef RESOURCE_KIND
+#endif // RESOURCE_KIND
+
+#ifdef RESOURCE_FLAG
+RESOURCE_FLAG(0, None)
+RESOURCE_FLAG(1, UsedByAtomic64)
+
+#undef RESOURCE_FLAG
+#endif // RESOURCE_FLAG
+
 #ifdef D3D_SYSTEM_VALUE
 
 D3D_SYSTEM_VALUE(0, Undefined)
diff --git a/llvm/include/llvm/ObjectYAML/DXContainerYAML.h b/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
index 9c4d9e19f11ba3..e432359b7bbd07 100644
--- a/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
+++ b/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
@@ -176,6 +176,9 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DXContainerYAML::SignatureParameter)
 LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::PSV::SemanticKind)
 LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::PSV::ComponentType)
 LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::PSV::InterpolationMode)
+LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::PSV::ResourceType)
+LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::PSV::ResourceKind)
+LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::PSV::ResourceFlag)
 LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::D3DSystemValue)
 LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::SigComponentType)
 LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::SigMinPrecision)
diff --git a/llvm/lib/BinaryFormat/DXContainer.cpp b/llvm/lib/BinaryFormat/DXContainer.cpp
index 9c0e657b069697..efeb67acd3edc2 100644
--- a/llvm/lib/BinaryFormat/DXContainer.cpp
+++ b/llvm/lib/BinaryFormat/DXContainer.cpp
@@ -89,3 +89,34 @@ static const EnumEntry<PSV::InterpolationMode> InterpolationModeNames[] = {
 ArrayRef<EnumEntry<PSV::InterpolationMode>> PSV::getInterpolationModes() {
   return ArrayRef(InterpolationModeNames);
 }
+
+#define RESOURCE_TYPE(Val, Enum) {#Enum, PSV::ResourceType::Enum},
+
+static const EnumEntry<PSV::ResourceType> ResourceTypeNames[] = {
+#include "llvm/BinaryFormat/DXContainerConstants.def"
+};
+
+ArrayRef<EnumEntry<PSV::ResourceType>> PSV::getResourceTypes() {
+  return ArrayRef(ResourceTypeNames);
+}
+
+#define RESOURCE_KIND(Val, Enum) {#Enum, PSV::ResourceKind::Enum},
+
+static const EnumEntry<PSV::ResourceKind> ResourceKindNames[] = {
+#include "llvm/BinaryFormat/DXContainerConstants.def"
+};
+
+ArrayRef<EnumEntry<PSV::ResourceKind>> PSV::getResourceKinds() {
+  return ArrayRef(ResourceKindNames);
+}
+
+#define RESOURCE_FLAG(Val, Enum) {#Enum, PSV::ResourceFlag::Enum},
+
+static const EnumEntry<PSV::ResourceFlag> ResourceFlagNames[] = {
+#include "llvm/BinaryFormat/DXContainerConstants.def"
+};
+
+ArrayRef<EnumEntry<PSV::ResourceFlag>> PSV::getResourceFlags() {
+  return ArrayRef(ResourceFlagNames);
+}
+
diff --git a/llvm/lib/ObjectYAML/DXContainerYAML.cpp b/llvm/lib/ObjectYAML/DXContainerYAML.cpp
index 38063670aee6e8..21a966d5abd132 100644
--- a/llvm/lib/ObjectYAML/DXContainerYAML.cpp
+++ b/llvm/lib/ObjectYAML/DXContainerYAML.cpp
@@ -254,6 +254,24 @@ void ScalarEnumerationTraits<dxbc::PSV::InterpolationMode>::enumeration(
     IO.enumCase(Value, E.Name.str().c_str(), E.Value);
 }
 
+void ScalarEnumerationTraits<dxbc::PSV::ResourceType>::enumeration(
+    IO &IO, dxbc::PSV::ResourceType &Value) {
+  for (const auto &E : dxbc::PSV::getResourceTypes())
+    IO.enumCase(Value, E.Name.str().c_str(), E.Value);
+}
+
+void ScalarEnumerationTraits<dxbc::PSV::ResourceKind>::enumeration(
+    IO &IO, dxbc::PSV::ResourceKind &Value) {
+  for (const auto &E : dxbc::PSV::getResourceKinds())
+    IO.enumCase(Value, E.Name.str().c_str(), E.Value);
+}
+
+void ScalarEnumerationTraits<dxbc::PSV::ResourceFlag>::enumeration(
+    IO &IO, dxbc::PSV::ResourceFlag &Value) {
+  for (const auto &E : dxbc::PSV::getResourceFlags())
+    IO.enumCase(Value, E.Name.str().c_str(), E.Value);
+}
+
 void ScalarEnumerationTraits<dxbc::D3DSystemValue>::enumeration(
     IO &IO, dxbc::D3DSystemValue &Value) {
   for (const auto &E : dxbc::getD3DSystemValues())
diff --git a/llvm/test/ObjectYAML/DXContainer/DomainMaskVectors.yaml b/llvm/test/ObjectYAML/DXContainer/DomainMaskVectors.yaml
index 713fbc61e094b5..04e9edd7398ec0 100644
--- a/llvm/test/ObjectYAML/DXContainer/DomainMaskVectors.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/DomainMaskVectors.yaml
@@ -70,12 +70,12 @@ Parts:
       NumThreadsZ:     0
       ResourceStride:  24
       Resources:
-        - Type:            2
+        - Type:            CBV
           Space:           0
           LowerBound:      0
           UpperBound:      0
-          Kind:            13
-          Flags:           0
+          Kind:            CBuffer
+          Flags:           None
       SigInputElements:
         - Name:            AAA_HSFoo
           Indices:         [ 0 ]
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-amplification.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-amplification.yaml
index d15bfadda41f07..3597b684fa032a 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv0-amplification.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-amplification.yaml
@@ -19,11 +19,11 @@ Parts:
       MaximumWaveLaneCount: 4294967295
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -48,11 +48,11 @@ Parts:
 # CHECK-NEXT: MaximumWaveLaneCount: 4294967295
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-compute.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-compute.yaml
index 7e9f2fbd8b54de..4f8e60b780c560 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv0-compute.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-compute.yaml
@@ -18,11 +18,11 @@ Parts:
       MaximumWaveLaneCount: 4294967295
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -46,11 +46,11 @@ Parts:
 # CHECK-NEXT: MaximumWaveLaneCount: 4294967295
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-domain.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-domain.yaml
index db2aee954b3466..fb8d148c286343 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv0-domain.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-domain.yaml
@@ -21,11 +21,11 @@ Parts:
       MaximumWaveLaneCount: 4294967295
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -52,11 +52,11 @@ Parts:
 # CHECK-NEXT: MaximumWaveLaneCount: 4294967295
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-geometry.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-geometry.yaml
index 5509ac669e2d6b..cd59c6a10d1a3e 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv0-geometry.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-geometry.yaml
@@ -22,11 +22,11 @@ Parts:
       MaximumWaveLaneCount: 4294967295
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -54,11 +54,11 @@ Parts:
 # CHECK-NEXT: MaximumWaveLaneCount: 4294967295
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-hull.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-hull.yaml
index cd60f2b192b2e2..a672f9260516a4 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv0-hull.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-hull.yaml
@@ -22,11 +22,11 @@ Parts:
       MaximumWaveLaneCount: 4294967295
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -54,11 +54,11 @@ Parts:
 # CHECK-NEXT: MaximumWaveLaneCount: 4294967295
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-mesh.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-mesh.yaml
index 07fb656c5b72a7..07fee2ff65e5bf 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv0-mesh.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-mesh.yaml
@@ -23,11 +23,11 @@ Parts:
       MaximumWaveLaneCount: 4294967295
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -56,11 +56,11 @@ Parts:
 # CHECK-NEXT: MaximumWaveLaneCount: 4294967295
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-pixel.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-pixel.yaml
index c7f956e5740cca..6bf18f340c3399 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv0-pixel.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-pixel.yaml
@@ -20,11 +20,11 @@ Parts:
       MaximumWaveLaneCount: 4294967295
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -50,11 +50,11 @@ Parts:
 # CHECK-NEXT: MaximumWaveLaneCount: 4294967295
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-vertex.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-vertex.yaml
index 6df9169b73e2f5..e0690fba0e8c4c 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv0-vertex.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-vertex.yaml
@@ -19,11 +19,11 @@ Parts:
       MaximumWaveLaneCount: 4294967295
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -48,11 +48,11 @@ Parts:
 # CHECK-NEXT: MaximumWaveLaneCount: 4294967295
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-amplification.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-amplification.yaml
index 982235549cddc6..beb85ee9828207 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv1-amplification.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-amplification.yaml
@@ -22,11 +22,11 @@ Parts:
       SigOutputVectors: [ 8, 16, 32, 64 ]
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -62,11 +62,11 @@ Parts:
 # CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ]
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-compute.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-compute.yaml
index 629d45c65a2081..6c90fbb206c6af 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv1-compute.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-compute.yaml
@@ -21,11 +21,11 @@ Parts:
       SigOutputVectors: [ 8, 16, 32, 64 ]
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -60,11 +60,11 @@ Parts:
 # CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ]
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-domain.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-domain.yaml
index 941ec16544a2df..28a4884d1228f3 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv1-domain.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-domain.yaml
@@ -25,11 +25,11 @@ Parts:
       SigOutputVectors: [ 0, 16, 32, 64 ]
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -69,11 +69,11 @@ Parts:
 # CHECK-NEXT: SigOutputVectors: [ 0, 16, 32, 64 ]
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-geometry.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-geometry.yaml
index a666cc4464d457..2884fd75e73d56 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv1-geometry.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-geometry.yaml
@@ -26,11 +26,11 @@ Parts:
       SigOutputVectors: [ 8, 16, 32, 64 ]
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -70,11 +70,11 @@ Parts:
 # CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ]
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-hull.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-hull.yaml
index c0f0f41e2318bd..0e71276ad1c16f 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv1-hull.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-hull.yaml
@@ -26,11 +26,11 @@ Parts:
       SigOutputVectors: [ 0, 16, 32, 64 ]
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -71,11 +71,11 @@ Parts:
 # CHECK-NEXT: SigOutputVectors: [ 0, 16, 32, 64 ]
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-mesh.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-mesh.yaml
index f981cb99cb968d..1af47f95c5e723 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv1-mesh.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-mesh.yaml
@@ -28,11 +28,11 @@ Parts:
       SigOutputVectors: [ 8, 16, 32, 64 ]
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -74,11 +74,11 @@ Parts:
 # CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ]
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-pixel.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-pixel.yaml
index a7b6804fe5fe6c..156e83f655e4f1 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv1-pixel.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-pixel.yaml
@@ -23,11 +23,11 @@ Parts:
       SigOutputVectors: [ 8, 16, 32, 64 ]
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -64,11 +64,11 @@ Parts:
 # CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ]
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-vertex.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-vertex.yaml
index a9590ba7704040..020e2345c6eec2 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv1-vertex.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-vertex.yaml
@@ -22,11 +22,11 @@ Parts:
       SigOutputVectors: [ 8, 16, 32, 64 ]
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
@@ -62,11 +62,11 @@ Parts:
 # CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ]
 # CHECK-NEXT: ResourceStride: 16
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-amplification.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-amplification.yaml
index c1ad560f463e1e..5d76741b0a913d 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv2-amplification.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-amplification.yaml
@@ -25,18 +25,18 @@ Parts:
       NumThreadsZ:     2048
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -72,18 +72,18 @@ Parts:
 # CHECK-NEXT: NumThreadsZ:     2048
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-compute.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-compute.yaml
index dc0ac3af9aa34b..bff9da7bc58ff4 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv2-compute.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-compute.yaml
@@ -24,18 +24,18 @@ Parts:
       NumThreadsZ:     2048
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -70,18 +70,18 @@ Parts:
 # CHECK-NEXT: NumThreadsZ:     2048
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-domain.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-domain.yaml
index 03e23b06d05e47..88f7650c4b9331 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv2-domain.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-domain.yaml
@@ -28,18 +28,18 @@ Parts:
       NumThreadsZ:     2048
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -79,18 +79,18 @@ Parts:
 # CHECK-NEXT: NumThreadsZ:     2048
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-geometry.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-geometry.yaml
index b4a5efd2276c52..64f065cf329e61 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv2-geometry.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-geometry.yaml
@@ -29,18 +29,18 @@ Parts:
       NumThreadsZ:     2048
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -80,18 +80,18 @@ Parts:
 # CHECK-NEXT: NumThreadsZ:     2048
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-hull.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-hull.yaml
index a1c87343ee915b..bd225aaec07049 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv2-hull.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-hull.yaml
@@ -29,18 +29,18 @@ Parts:
       NumThreadsZ:     2048
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -81,18 +81,18 @@ Parts:
 # CHECK-NEXT: NumThreadsZ:     2048
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-mesh.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-mesh.yaml
index 6155a3e2354bce..82354e590d3055 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv2-mesh.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-mesh.yaml
@@ -31,18 +31,18 @@ Parts:
       NumThreadsZ:     2048
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -84,18 +84,18 @@ Parts:
 # CHECK-NEXT: NumThreadsZ:     2048
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-pixel.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-pixel.yaml
index 3fdd7be8fe7de9..c879d9160ee244 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv2-pixel.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-pixel.yaml
@@ -26,18 +26,18 @@ Parts:
       NumThreadsZ:     2048
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -74,18 +74,18 @@ Parts:
 # CHECK-NEXT: NumThreadsZ:     2048
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-vertex.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-vertex.yaml
index eb77fb1b10d77a..90ff72947b539f 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv2-vertex.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-vertex.yaml
@@ -25,18 +25,18 @@ Parts:
       NumThreadsZ:     2048
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -72,18 +72,18 @@ Parts:
 # CHECK-NEXT: NumThreadsZ:     2048
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv3-amplification.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv3-amplification.yaml
index 09885bd529f05f..7c7b0a6cc4feab 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv3-amplification.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv3-amplification.yaml
@@ -26,18 +26,18 @@ Parts:
       EntryName: ASEntry
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -74,18 +74,18 @@ Parts:
 # CHECK-NEXT: EntryName: ASEntry
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv3-compute.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv3-compute.yaml
index ee6fb112c77222..f737beecc372dd 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv3-compute.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv3-compute.yaml
@@ -25,18 +25,18 @@ Parts:
       EntryName: CSEntry
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -72,18 +72,18 @@ Parts:
 # CHECK-NEXT: EntryName: CSEntry
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv3-domain.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv3-domain.yaml
index dd367deae88e47..49f9b3f88eb9c9 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv3-domain.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv3-domain.yaml
@@ -29,18 +29,18 @@ Parts:
       EntryName: DSEntry
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -81,18 +81,18 @@ Parts:
 # CHECK-NEXT: EntryName: DSEntry
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv3-geometry.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv3-geometry.yaml
index 4c7680b63b02b6..724247050c1ed7 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv3-geometry.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv3-geometry.yaml
@@ -30,18 +30,18 @@ Parts:
       EntryName: GSEntry
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -82,18 +82,18 @@ Parts:
 # CHECK-NEXT: EntryName: GSEntry
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv3-hull.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv3-hull.yaml
index 3bbad8a9b0ee62..208a90dc68d123 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv3-hull.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv3-hull.yaml
@@ -30,18 +30,18 @@ Parts:
       EntryName: HSEntry
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -83,18 +83,18 @@ Parts:
 # CHECK-NEXT: EntryName: HSEntry
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv3-mesh.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv3-mesh.yaml
index c5ea1fcf078087..4af1f6e0e45332 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv3-mesh.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv3-mesh.yaml
@@ -32,18 +32,18 @@ Parts:
       EntryName: MSEntry
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -86,18 +86,18 @@ Parts:
 # CHECK-NEXT: EntryName: MSEntry
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv3-pixel.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv3-pixel.yaml
index b28d5ec8074d85..319572ae452b67 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv3-pixel.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv3-pixel.yaml
@@ -27,18 +27,18 @@ Parts:
       EntryName: PSEntry
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -76,18 +76,18 @@ Parts:
 # CHECK-NEXT: EntryName: PSEntry
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv3-vertex.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv3-vertex.yaml
index d1fb55839931ca..f257cc855ca2d8 100644
--- a/llvm/test/ObjectYAML/DXContainer/PSVv3-vertex.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/PSVv3-vertex.yaml
@@ -26,18 +26,18 @@ Parts:
       EntryName: VSEntry
       ResourceStride:       24
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-          Kind:            5
-          Flags:           6
-        - Type:            128
+          Kind:            TextureCube
+          Flags:           None
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
-          Kind:            65535
-          Flags:           16776960
+          Kind:            Invalid
+          Flags:           None
       SigInputElements: []
       SigOutputElements: []
       SigPatchOrPrimElements: []
@@ -74,18 +74,18 @@ Parts:
 # CHECK-NEXT: EntryName: VSEntry
 # CHECK-NEXT: ResourceStride: 24
 # CHECK-NEXT: Resources:
-# CHECK-NEXT: - Type:            1
+# CHECK-NEXT: - Type:            Sampler
 # CHECK-NEXT: Space:           2
 # CHECK-NEXT: LowerBound:      3
 # CHECK-NEXT: UpperBound:      4
-# CHECK-NEXT: Kind:            5
-# CHECK-NEXT: Flags:           6
-# CHECK-NEXT: - Type:            128
+# CHECK-NEXT: Kind:            TextureCube
+# CHECK-NEXT: Flags:           None
+# CHECK-NEXT: - Type:            Invalid
 # CHECK-NEXT: Space:           32768
 # CHECK-NEXT: LowerBound:      8388608
 # CHECK-NEXT: UpperBound:      2147483648
-# CHECK-NEXT: Kind:            65535
-# CHECK-NEXT: Flags:           16776960
+# CHECK-NEXT: Kind:            Invalid
+# CHECK-NEXT: Flags:           None
 # CHECK-NEXT: SigInputElements: []
 # CHECK-NEXT: SigOutputElements: []
 # CHECK-NEXT: SigPatchOrPrimElements: []
diff --git a/llvm/test/ObjectYAML/DXContainer/SigElements.yaml b/llvm/test/ObjectYAML/DXContainer/SigElements.yaml
index 47a18a6487c975..e7c72761901ebc 100644
--- a/llvm/test/ObjectYAML/DXContainer/SigElements.yaml
+++ b/llvm/test/ObjectYAML/DXContainer/SigElements.yaml
@@ -23,11 +23,11 @@ Parts:
       SigOutputVectors: [ 8, 16, 32, 64 ]
       ResourceStride:       16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           2
           LowerBound:      3
           UpperBound:      4
-        - Type:            128
+        - Type:            Invalid
           Space:           32768
           LowerBound:      8388608
           UpperBound:      2147483648
diff --git a/llvm/unittests/Object/DXContainerTest.cpp b/llvm/unittests/Object/DXContainerTest.cpp
index 9da6543c520c74..e4337fd77b70b5 100644
--- a/llvm/unittests/Object/DXContainerTest.cpp
+++ b/llvm/unittests/Object/DXContainerTest.cpp
@@ -266,15 +266,15 @@ TEST(DXCFile, PSVResourceIterators) {
       MaximumWaveLaneCount: 4294967295
       ResourceStride:  16
       Resources:
-        - Type:            1
+        - Type:            Sampler
           Space:           1
           LowerBound:      1
           UpperBound:      1
-        - Type:            2
+        - Type:            CBV
           Space:           2
           LowerBound:      2
           UpperBound:      2
-        - Type:            3
+        - Type:            SRVTyped
           Space:           3
           LowerBound:      3
           UpperBound:      3
@@ -308,40 +308,40 @@ TEST(DXCFile, PSVResourceIterators) {
   dxbc::PSV::v2::ResourceBindInfo Binding;
 
   Binding = *It;
-  EXPECT_EQ(Binding.Type, 1u);
-  EXPECT_EQ(Binding.Flags, 0u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::Sampler);
+  EXPECT_EQ(Binding.Flags, dxbc::PSV::ResourceFlag::None);
 
   ++It;
   Binding = *It;
 
-  EXPECT_EQ(Binding.Type, 2u);
-  EXPECT_EQ(Binding.Flags, 0u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::CBV);
+  EXPECT_EQ(Binding.Flags, dxbc::PSV::ResourceFlag::None);
 
   --It;
   Binding = *It;
 
   EXPECT_TRUE(It == PSVInfo->getResources().begin());
 
-  EXPECT_EQ(Binding.Type, 1u);
-  EXPECT_EQ(Binding.Flags, 0u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::Sampler);
+  EXPECT_EQ(Binding.Flags, dxbc::PSV::ResourceFlag::None);
 
   --It;
   Binding = *It;
 
-  EXPECT_EQ(Binding.Type, 1u);
-  EXPECT_EQ(Binding.Flags, 0u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::Sampler);
+  EXPECT_EQ(Binding.Flags, dxbc::PSV::ResourceFlag::None);
 
   ++It;
   Binding = *It;
 
-  EXPECT_EQ(Binding.Type, 2u);
-  EXPECT_EQ(Binding.Flags, 0u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::CBV);
+  EXPECT_EQ(Binding.Flags, dxbc::PSV::ResourceFlag::None);
 
   ++It;
   Binding = *It;
 
-  EXPECT_EQ(Binding.Type, 3u);
-  EXPECT_EQ(Binding.Flags, 0u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::SRVTyped);
+  EXPECT_EQ(Binding.Flags, dxbc::PSV::ResourceFlag::None);
 
   EXPECT_FALSE(It == PSVInfo->getResources().end());
 
@@ -351,8 +351,8 @@ TEST(DXCFile, PSVResourceIterators) {
   EXPECT_TRUE(It == PSVInfo->getResources().end());
   EXPECT_FALSE(It != PSVInfo->getResources().end());
 
-  EXPECT_EQ(Binding.Type, 0u);
-  EXPECT_EQ(Binding.Flags, 0u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::Invalid);
+  EXPECT_EQ(Binding.Flags, dxbc::PSV::ResourceFlag::None);
 
   {
     auto Old = It++;
@@ -361,30 +361,30 @@ TEST(DXCFile, PSVResourceIterators) {
     EXPECT_TRUE(Old == PSVInfo->getResources().end());
     EXPECT_FALSE(Old != PSVInfo->getResources().end());
 
-    EXPECT_EQ(Binding.Type, 0u);
-    EXPECT_EQ(Binding.Flags, 0u);
+    EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::Invalid);
+    EXPECT_EQ(Binding.Flags, dxbc::PSV::ResourceFlag::None);
   }
 
   Binding = *It;
 
   EXPECT_TRUE(It == PSVInfo->getResources().end());
 
-  EXPECT_EQ(Binding.Type, 0u);
-  EXPECT_EQ(Binding.Flags, 0u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::Invalid);
+  EXPECT_EQ(Binding.Flags, dxbc::PSV::ResourceFlag::None);
 
   {
     auto Old = It--;
     Binding = *Old;
     EXPECT_TRUE(Old == PSVInfo->getResources().end());
 
-    EXPECT_EQ(Binding.Type, 0u);
-    EXPECT_EQ(Binding.Flags, 0u);
+    EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::Invalid);
+    EXPECT_EQ(Binding.Flags, dxbc::PSV::ResourceFlag::None);
   }
 
   Binding = *It;
 
-  EXPECT_EQ(Binding.Type, 3u);
-  EXPECT_EQ(Binding.Flags, 0u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::SRVTyped);
+  EXPECT_EQ(Binding.Flags, dxbc::PSV::ResourceFlag::None);
 }
 
 // The malicious file bits in these tests are mutations of the binary produced
@@ -587,7 +587,7 @@ TEST(DXCFile, PSVResourceIteratorsStride) {
   dxbc::PSV::v2::ResourceBindInfo Binding;
 
   Binding = *It;
-  EXPECT_EQ(Binding.Type, 1u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::Sampler);
   EXPECT_EQ(Binding.Space, 2u);
   EXPECT_EQ(Binding.LowerBound, 3u);
   EXPECT_EQ(Binding.UpperBound, 4u);
@@ -595,7 +595,7 @@ TEST(DXCFile, PSVResourceIteratorsStride) {
   ++It;
   Binding = *It;
 
-  EXPECT_EQ(Binding.Type, 5u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::SRVStructured);
   EXPECT_EQ(Binding.Space, 6u);
   EXPECT_EQ(Binding.LowerBound, 7u);
   EXPECT_EQ(Binding.UpperBound, 8u);
@@ -605,7 +605,7 @@ TEST(DXCFile, PSVResourceIteratorsStride) {
 
   EXPECT_TRUE(It == PSVInfo->getResources().begin());
 
-  EXPECT_EQ(Binding.Type, 1u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::Sampler);
   EXPECT_EQ(Binding.Space, 2u);
   EXPECT_EQ(Binding.LowerBound, 3u);
   EXPECT_EQ(Binding.UpperBound, 4u);
@@ -613,7 +613,7 @@ TEST(DXCFile, PSVResourceIteratorsStride) {
   --It;
   Binding = *It;
 
-  EXPECT_EQ(Binding.Type, 1u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::Sampler);
   EXPECT_EQ(Binding.Space, 2u);
   EXPECT_EQ(Binding.LowerBound, 3u);
   EXPECT_EQ(Binding.UpperBound, 4u);
@@ -621,7 +621,7 @@ TEST(DXCFile, PSVResourceIteratorsStride) {
   ++It;
   Binding = *It;
 
-  EXPECT_EQ(Binding.Type, 5u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::SRVStructured);
   EXPECT_EQ(Binding.Space, 6u);
   EXPECT_EQ(Binding.LowerBound, 7u);
   EXPECT_EQ(Binding.UpperBound, 8u);;
@@ -635,8 +635,8 @@ TEST(DXCFile, PSVResourceIteratorsStride) {
   EXPECT_TRUE(It == PSVInfo->getResources().end());
   EXPECT_FALSE(It != PSVInfo->getResources().end());
 
-  EXPECT_EQ(Binding.Type, 0u);
-  EXPECT_EQ(Binding.Flags, 0u);
+  EXPECT_EQ(Binding.Type, dxbc::PSV::ResourceType::Invalid);
+  EXPECT_EQ(Binding.Flags, dxbc::PSV::ResourceFlag::None);
 }
 
 // This test binary is created using mutations of the yaml in the SigElements

>From 37cd528a4888e37d8b1d640a2bb31e358de9ed5c Mon Sep 17 00:00:00 2001
From: Xiang Li <python3kgae at outlook.com>
Date: Tue, 27 Aug 2024 11:35:52 -0400
Subject: [PATCH 2/2] Fix clang-format.

---
 llvm/lib/BinaryFormat/DXContainer.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/llvm/lib/BinaryFormat/DXContainer.cpp b/llvm/lib/BinaryFormat/DXContainer.cpp
index efeb67acd3edc2..790947cc729c0b 100644
--- a/llvm/lib/BinaryFormat/DXContainer.cpp
+++ b/llvm/lib/BinaryFormat/DXContainer.cpp
@@ -119,4 +119,3 @@ static const EnumEntry<PSV::ResourceFlag> ResourceFlagNames[] = {
 ArrayRef<EnumEntry<PSV::ResourceFlag>> PSV::getResourceFlags() {
   return ArrayRef(ResourceFlagNames);
 }
-



More information about the llvm-commits mailing list