|
17 | 17 | #include "llvm/Support/SwapByteOrder.h" |
18 | 18 | #include "llvm/TargetParser/Triple.h" |
19 | 19 |
|
20 | | -#include <cstdint> |
21 | 20 | #include <stdint.h> |
22 | 21 |
|
23 | 22 | namespace llvm { |
@@ -64,19 +63,55 @@ struct ShaderHash { |
64 | 63 | void swapBytes() { sys::swapByteOrder(Flags); } |
65 | 64 | }; |
66 | 65 |
|
67 | | -<<<<<<< HEAD |
68 | | -struct RootSignatureDesc { |
69 | | - uint32_t Size; |
70 | | - uint32_t Flags; |
| 66 | +#define ROOT_PARAMETER(Val, Enum) Enum = Val, |
| 67 | +enum class RootParameterType : uint8_t { |
| 68 | +#include "DXContainerConstants.def" |
| 69 | +}; |
| 70 | + |
| 71 | +ArrayRef<EnumEntry<RootParameterType>> getRootParameterTypes(); |
| 72 | + |
| 73 | + |
| 74 | +#define SHADER_VISIBILITY(Val, Enum) Enum = Val, |
| 75 | +enum class ShaderVisibilityFlag : uint8_t { |
| 76 | +#include "DXContainerConstants.def" |
| 77 | +}; |
| 78 | + |
| 79 | +ArrayRef<EnumEntry<ShaderVisibilityFlag>> getShaderVisibilityFlags(); |
| 80 | + |
| 81 | +struct RootConstants { |
| 82 | + uint32_t ShaderRegister; |
| 83 | + uint32_t RegisterSpace; |
| 84 | + uint32_t Num32BitValues; |
71 | 85 |
|
72 | 86 | void swapBytes() { |
73 | | - sys::swapByteOrder(Size); |
74 | | - sys::swapByteOrder(Flags); |
| 87 | + sys::swapByteOrder(ShaderRegister); |
| 88 | + sys::swapByteOrder(RegisterSpace); |
| 89 | + sys::swapByteOrder(Num32BitValues); |
| 90 | + } |
| 91 | +}; |
| 92 | + |
| 93 | +struct RootParameter { |
| 94 | + RootParameterType ParameterType; |
| 95 | + union { |
| 96 | + RootConstants Constants; |
| 97 | + }; |
| 98 | + ShaderVisibilityFlag ShaderVisibility; |
| 99 | + |
| 100 | + void swapBytes() { |
| 101 | + switch (ParameterType) { |
| 102 | + |
| 103 | + case RootParameterType::Constants32Bit: |
| 104 | + Constants.swapBytes(); |
| 105 | + break; |
| 106 | + case RootParameterType::DescriptorTable: |
| 107 | + case RootParameterType::CBV: |
| 108 | + case RootParameterType::SRV: |
| 109 | + case RootParameterType::UAV: |
| 110 | + break; |
| 111 | + } |
75 | 112 | } |
76 | 113 | }; |
77 | 114 |
|
78 | | -======= |
79 | | ->>>>>>> b1b967db8d32 (adding support for root constants in dxcontainer for ob2jyaml and yaml2obj tools) |
80 | 115 | struct ContainerVersion { |
81 | 116 | uint16_t Major; |
82 | 117 | uint16_t Minor; |
@@ -171,50 +206,6 @@ enum class RootElementFlag : uint32_t { |
171 | 206 | #include "DXContainerConstants.def" |
172 | 207 | }; |
173 | 208 |
|
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 | | - |
218 | 209 | PartType parsePartType(StringRef S); |
219 | 210 |
|
220 | 211 | struct VertexPSVInfo { |
@@ -556,8 +547,6 @@ enum class SigComponentType : uint32_t { |
556 | 547 | }; |
557 | 548 |
|
558 | 549 | ArrayRef<EnumEntry<SigComponentType>> getSigComponentTypes(); |
559 | | -ArrayRef<EnumEntry<RootParameterType>> getRootParameterTypes(); |
560 | | -ArrayRef<EnumEntry<ShaderVisibilityFlag>> getShaderVisibilityFlags(); |
561 | 550 |
|
562 | 551 | struct ProgramSignatureHeader { |
563 | 552 | uint32_t ParamCount; |
|
0 commit comments