23static_assert((
uint64_t)dxbc::FeatureFlags::NextUnusedBit <= 1ull << 63,
24 "Shader flag bits exceed enum size.");
27#define SHADER_FEATURE_FLAG(Num, DxilModuleNum, Val, Str) \
28 Val = (FlagData & (uint64_t)dxbc::FeatureFlags::Val) > 0;
29#include "llvm/BinaryFormat/DXContainerConstants.def"
34#define SHADER_FEATURE_FLAG(Num, DxilModuleNum, Val, Str) \
36 Flag |= (uint64_t)dxbc::FeatureFlags::Val;
37#include "llvm/BinaryFormat/DXContainerConstants.def"
43 dxbc::HashFlags::IncludesSource)) != 0),
58 assert(Stage < std::numeric_limits<uint8_t>::max() &&
59 "Stage should be a very small number");
80 EntryName(StringTable.
substr(
P->EntryNameOffset,
81 StringTable.
find(
'\0',
P->EntryNameOffset) -
82 P->EntryNameOffset)) {
91 IO.mapRequired(
"Major", Version.Major);
92 IO.mapRequired(
"Minor", Version.Minor);
97 IO.mapRequired(
"Hash", Header.Hash);
98 IO.mapRequired(
"Version", Header.Version);
99 IO.mapOptional(
"FileSize", Header.FileSize);
100 IO.mapRequired(
"PartCount", Header.PartCount);
101 IO.mapOptional(
"PartOffsets", Header.PartOffsets);
108 IO.mapRequired(
"ShaderKind", Program.
ShaderKind);
109 IO.mapOptional(
"Size", Program.
Size);
112 IO.mapOptional(
"DXILSize", Program.
DXILSize);
113 IO.mapOptional(
"DXIL", Program.
DXIL);
118#define SHADER_FEATURE_FLAG(Num, DxilModuleNum, Val, Str) \
119 IO.mapRequired(#Val, Flags.Val);
120#include "llvm/BinaryFormat/DXContainerConstants.def"
126 IO.mapRequired(
"Digest", Hash.
Digest);
131 IO.mapRequired(
"Version", PSV.
Version);
134 void *OldContext = IO.getContext();
136 IO.setContext(&Version);
139 auto RestoreContext =
make_scope_exit([&]() { IO.setContext(OldContext); });
147 IO.mapRequired(
"Resources", PSV.
Resources);
158 IO.mapRequired(
"OutputVectorMasks", MutableOutMasks);
159 if (Stage == Triple::EnvironmentType::Hull)
164 IO.mapRequired(
"InputOutputMap", MutableIOMap);
166 if (Stage == Triple::EnvironmentType::Hull)
169 if (Stage == Triple::EnvironmentType::Domain)
175 IO.mapRequired(
"Stream", S.
Stream);
176 IO.mapRequired(
"Name", S.
Name);
177 IO.mapRequired(
"Index", S.
Index);
179 IO.mapRequired(
"CompType", S.
CompType);
180 IO.mapRequired(
"Register", S.
Register);
181 IO.mapRequired(
"Mask", S.
Mask);
193 IO.mapRequired(
"Name",
P.Name);
194 IO.mapRequired(
"Size",
P.Size);
195 IO.mapOptional(
"Program",
P.Program);
196 IO.mapOptional(
"Flags",
P.Flags);
197 IO.mapOptional(
"Hash",
P.Hash);
198 IO.mapOptional(
"PSVInfo",
P.Info);
199 IO.mapOptional(
"Signature",
P.Signature);
204 IO.mapTag(
"!dxcontainer",
true);
205 IO.mapRequired(
"Header", Obj.
Header);
206 IO.mapRequired(
"Parts", Obj.
Parts);
211 IO.mapRequired(
"Type", Res.
Type);
212 IO.mapRequired(
"Space", Res.
Space);
220 IO.mapRequired(
"Kind", Res.
Kind);
221 IO.mapRequired(
"Flags", Res.
Flags);
226 IO.mapRequired(
"Name", El.
Name);
227 IO.mapRequired(
"Indices", El.
Indices);
228 IO.mapRequired(
"StartRow", El.
StartRow);
229 IO.mapRequired(
"Cols", El.
Cols);
230 IO.mapRequired(
"StartCol", El.
StartCol);
231 IO.mapRequired(
"Allocated", El.
Allocated);
232 IO.mapRequired(
"Kind", El.
Kind);
233 IO.mapRequired(
"ComponentType", El.
Type);
234 IO.mapRequired(
"Interpolation", El.
Mode);
236 IO.mapRequired(
"Stream", El.
Stream);
239void ScalarEnumerationTraits<dxbc::PSV::SemanticKind>::enumeration(
241 for (
const auto &
E : dxbc::PSV::getSemanticKinds())
242 IO.enumCase(
Value,
E.Name.str().c_str(),
E.Value);
245void ScalarEnumerationTraits<dxbc::PSV::ComponentType>::enumeration(
247 for (
const auto &
E : dxbc::PSV::getComponentTypes())
248 IO.enumCase(
Value,
E.Name.str().c_str(),
E.Value);
251void ScalarEnumerationTraits<dxbc::PSV::InterpolationMode>::enumeration(
252 IO &IO, dxbc::PSV::InterpolationMode &Value) {
253 for (
const auto &
E : dxbc::PSV::getInterpolationModes())
254 IO.enumCase(Value,
E.Name.str().c_str(),
E.Value);
257void ScalarEnumerationTraits<dxbc::D3DSystemValue>::enumeration(
258 IO &IO, dxbc::D3DSystemValue &Value) {
259 for (
const auto &
E : dxbc::getD3DSystemValues())
260 IO.enumCase(Value,
E.Name.str().c_str(),
E.Value);
263void ScalarEnumerationTraits<dxbc::SigMinPrecision>::enumeration(
264 IO &IO, dxbc::SigMinPrecision &Value) {
265 for (
const auto &
E : dxbc::getSigMinPrecisions())
266 IO.enumCase(Value,
E.Name.str().c_str(),
E.Value);
269void ScalarEnumerationTraits<dxbc::SigComponentType>::enumeration(
270 IO &IO, dxbc::SigComponentType &Value) {
271 for (
const auto &
E : dxbc::getSigComponentTypes())
272 IO.enumCase(Value,
E.Name.str().c_str(),
E.Value);
296 IO.mapRequired(
"InputControlPointCount",
298 IO.mapRequired(
"OutputControlPointCount",
301 IO.mapRequired(
"TessellatorOutputPrimitive",
305 IO.mapRequired(
"InputControlPointCount",
312 IO.mapRequired(
"GroupSharedBytesDependentOnViewID",
325 IO.mapRequired(
"MinimumWaveLaneCount",
Info.MinimumWaveLaneCount);
326 IO.mapRequired(
"MaximumWaveLaneCount",
Info.MaximumWaveLaneCount);
331 IO.mapRequired(
"UsesViewID",
Info.UsesViewID);
335 IO.mapRequired(
"MaxVertexCount",
Info.GeomData.MaxVertexCount);
339 IO.mapRequired(
"SigPatchConstOrPrimVectors",
340 Info.GeomData.SigPatchConstOrPrimVectors);
343 IO.mapRequired(
"SigPrimVectors",
Info.GeomData.MeshInfo.SigPrimVectors);
344 IO.mapRequired(
"MeshOutputTopology",
345 Info.GeomData.MeshInfo.MeshOutputTopology);
351 IO.mapRequired(
"SigInputVectors",
Info.SigInputVectors);
353 IO.mapRequired(
"SigOutputVectors", Vec);
358 IO.mapRequired(
"NumThreadsX",
Info.NumThreadsX);
359 IO.mapRequired(
"NumThreadsY",
Info.NumThreadsY);
360 IO.mapRequired(
"NumThreadsZ",
Info.NumThreadsZ);
365 IO.mapRequired(
"EntryName", EntryName);
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Analysis containing CSE Info
This file declares classes for handling the YAML representation of DXContainer.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the make_scope_exit function, which executes user-defined cleanup logic at scope ex...
static StringRef substr(StringRef Str, uint64_t Len)
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
Triple::EnvironmentType getShaderStage(uint32_t Kind)
This is an optimization pass for GlobalISel generic memory operations.
auto find(R &&Range, const T &Val)
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.
detail::scope_exit< std::decay_t< Callable > > make_scope_exit(Callable &&F)
uint16_t DXILMajorVersion
std::optional< uint32_t > Size
uint16_t DXILMinorVersion
std::optional< std::vector< llvm::yaml::Hex8 > > DXIL
std::optional< uint32_t > DXILSize
std::vector< Part > Parts
std::array< MaskVector, 4 > InputOutputMap
MaskVector PatchOutputMap
SmallVector< SignatureElement > SigOutputElements
MaskVector PatchOrPrimMasks
SmallVector< SignatureElement > SigPatchOrPrimElements
SmallVector< ResourceBindInfo > Resources
SmallVector< SignatureElement > SigInputElements
void mapInfoForVersion(yaml::IO &IO)
dxbc::PSV::v3::RuntimeInfo Info
std::array< MaskVector, 4 > OutputVectorMasks
ShaderFeatureFlags()=default
uint64_t getEncodedFlags()
std::vector< llvm::yaml::Hex8 > Digest
dxbc::PSV::ComponentType Type
dxbc::PSV::InterpolationMode Mode
llvm::yaml::Hex8 DynamicMask
dxbc::PSV::SemanticKind Kind
SmallVector< uint32_t > Indices
dxbc::SigComponentType CompType
dxbc::SigMinPrecision MinPrecision
dxbc::D3DSystemValue SystemValue
llvm::SmallVector< SignatureParameter > Parameters
uint32_t PayloadSizeInBytes
uint32_t InputControlPointCount
uint32_t TessellatorDomain
uint8_t OutputPositionPresent
uint8_t OutputPositionPresent
uint32_t OutputStreamMask
uint32_t TessellatorOutputPrimitive
uint32_t OutputControlPointCount
uint32_t InputControlPointCount
uint32_t TessellatorDomain
uint32_t PayloadSizeInBytes
uint16_t MaxOutputVertices
uint16_t MaxOutputPrimitives
uint32_t GroupSharedBytesDependentOnViewID
uint32_t GroupSharedBytesUsed
uint8_t OutputPositionPresent