1717#include " llvm/Support/SwapByteOrder.h"
1818#include " llvm/TargetParser/Triple.h"
1919
20+ #include < cstdint>
2021#include < stdint.h>
2122
2223namespace llvm {
@@ -63,6 +64,7 @@ struct ShaderHash {
6364 void swapBytes () { sys::swapByteOrder (Flags); }
6465};
6566
67+ <<<<<<< HEAD
6668struct RootSignatureDesc {
6769 uint32_t Size;
6870 uint32_t Flags;
@@ -73,6 +75,8 @@ struct RootSignatureDesc {
7375 }
7476};
7577
78+ =======
79+ >>>>>>> b1b967db8d32 (adding support for root constants in dxcontainer for ob2jyaml and yaml2obj tools)
7680struct ContainerVersion {
7781 uint16_t Major;
7882 uint16_t Minor;
@@ -167,6 +171,50 @@ enum class RootElementFlag : uint32_t {
167171#include " DXContainerConstants.def"
168172};
169173
174+ #define ROOT_PARAMETER (Val, Enum ) Enum = Val,
175+ enum class RootParameterType : uint8_t {
176+ #include " DXContainerConstants.def"
177+ };
178+
179+ #define SHADER_VISIBILITY (Val, Enum ) Enum = Val,
180+ enum class ShaderVisibilityFlag : uint8_t {
181+ #include " DXContainerConstants.def"
182+ };
183+
184+ struct RootConstants {
185+ uint32_t ShaderRegister;
186+ uint32_t RegisterSpace;
187+ uint32_t Num32BitValues;
188+
189+ void swapBytes () {
190+ sys::swapByteOrder (ShaderRegister);
191+ sys::swapByteOrder (RegisterSpace);
192+ sys::swapByteOrder (Num32BitValues);
193+ }
194+ };
195+
196+ struct RootParameter {
197+ RootParameterType ParameterType;
198+ union {
199+ RootConstants Constants;
200+ };
201+ ShaderVisibilityFlag ShaderVisibility;
202+
203+ void swapBytes () {
204+ switch (ParameterType) {
205+
206+ case RootParameterType::Constants32Bit:
207+ Constants.swapBytes ();
208+ break ;
209+ case RootParameterType::DescriptorTable:
210+ case RootParameterType::CBV:
211+ case RootParameterType::SRV:
212+ case RootParameterType::UAV:
213+ break ;
214+ }
215+ }
216+ };
217+
170218PartType parsePartType (StringRef S);
171219
172220struct VertexPSVInfo {
@@ -508,6 +556,8 @@ enum class SigComponentType : uint32_t {
508556};
509557
510558ArrayRef<EnumEntry<SigComponentType>> getSigComponentTypes ();
559+ ArrayRef<EnumEntry<RootParameterType>> getRootParameterTypes ();
560+ ArrayRef<EnumEntry<ShaderVisibilityFlag>> getShaderVisibilityFlags ();
511561
512562struct ProgramSignatureHeader {
513563 uint32_t ParamCount;
0 commit comments