15#ifndef LLVM_OBJECT_DXCONTAINER_H
16#define LLVM_OBJECT_DXCONTAINER_H
130 InfoStruct BasicInfo;
138 std::array<ViewArray<uint32_t>, 4> OutputVectorMasks;
140 std::array<ViewArray<uint32_t>, 4> InputOutputMap;
164 const InfoStruct &
getInfo()
const {
return BasicInfo; }
167 if (
const auto *
P = std::get_if<dxbc::PSV::v3::RuntimeInfo>(&BasicInfo))
168 return static_cast<const T *
>(
P);
169 if (std::is_same<T, dxbc::PSV::v3::RuntimeInfo>::value)
172 if (
const auto *
P = std::get_if<dxbc::PSV::v2::RuntimeInfo>(&BasicInfo))
173 return static_cast<const T *
>(
P);
174 if (std::is_same<T, dxbc::PSV::v2::RuntimeInfo>::value)
177 if (
const auto *
P = std::get_if<dxbc::PSV::v1::RuntimeInfo>(&BasicInfo))
178 return static_cast<const T *
>(
P);
179 if (std::is_same<T, dxbc::PSV::v1::RuntimeInfo>::value)
182 if (
const auto *
P = std::get_if<dxbc::PSV::v0::RuntimeInfo>(&BasicInfo))
183 return static_cast<const T *
>(
P);
189 return SemanticIndexTable;
199 return SigPatchOrPrimElements;
204 return OutputVectorMasks[
Idx];
211 return InputOutputMap[
Idx];
220 if (
const auto *
P = getInfoAs<dxbc::PSV::v1::RuntimeInfo>())
221 return P->UsesViewID != 0;
226 if (
const auto *
P = getInfoAs<dxbc::PSV::v1::RuntimeInfo>())
227 return P->SigInputVectors;
232 if (
const auto *
P = getInfoAs<dxbc::PSV::v1::RuntimeInfo>())
238 if (
const auto *
P = getInfoAs<dxbc::PSV::v1::RuntimeInfo>())
239 return P->GeomData.SigPatchConstOrPrimVectors;
251 return Parameters.begin();
255 return Parameters.end();
261 "Offset out of range.");
266 return StringTable.slice(TableOffset, StringTable.find(
'\0', TableOffset));
269 bool isEmpty()
const {
return Parameters.isEmpty(); }
278 using DXILData = std::pair<dxbc::ProgramHeader, const char *>;
286 std::optional<DXILData> DXIL;
287 std::optional<uint64_t> ShaderFeatureFlags;
288 std::optional<dxbc::ShaderHash> Hash;
289 std::optional<DirectX::PSVRuntimeInfo> PSVInfo;
295 Error parsePartOffsets();
320 : Container(
C), OffsetIt(It) {
321 if (OffsetIt == Container.PartOffsets.
end())
322 updateIteratorImpl(Container.PartOffsets.
back());
330 void updateIterator() {
331 if (OffsetIt != Container.PartOffsets.
end())
332 updateIteratorImpl(*OffsetIt);
341 if (OffsetIt == Container.PartOffsets.
end())
355 return OffsetIt ==
RHS.OffsetIt;
359 return OffsetIt !=
RHS.OffsetIt;
377 const std::optional<DXILData> &
getDXIL()
const {
return DXIL; }
380 return ShaderFeatureFlags;
385 const std::optional<DirectX::PSVRuntimeInfo> &
getPSVInfo()
const {
391 return OutputSignature;
394 return PatchConstantSignature;
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
Given that RA is a live value
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
typename SuperClass::const_iterator const_iterator
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
constexpr size_t size() const
size - Get the string size.
const PartData & operator*()
PartIterator operator++(int)
const PartData * operator->()
PartIterator & operator++()
bool operator!=(const PartIterator &RHS) const
bool operator==(const PartIterator &RHS) const
std::optional< uint64_t > getShaderFeatureFlags() const
const std::optional< DXILData > & getDXIL() const
const std::optional< DirectX::PSVRuntimeInfo > & getPSVInfo() const
const dxbc::Header & getHeader() const
const DirectX::Signature & getInputSignature() const
std::pair< dxbc::ProgramHeader, const char * > DXILData
StringRef getData() const
PartIterator begin() const
static Expected< DXContainer > create(MemoryBufferRef Object)
std::optional< dxbc::ShaderHash > getShaderHash() const
const DirectX::Signature & getOutputSignature() const
const DirectX::Signature & getPatchConstantSignature() const
uint32_t getResourceStride() const
ArrayRef< uint8_t > getOutputVectorCounts() const
ArrayRef< uint32_t > getSemanticIndexTable() const
ResourceArray getResources() const
ViewArray< uint32_t > getInputOutputMap(size_t Idx) const
uint8_t getPatchConstOrPrimVectorCount() const
uint8_t getSigInputCount() const
ViewArray< uint32_t > getPatchOrPrimMasks() const
uint8_t getSigPatchOrPrimCount() const
StringRef getStringTable() const
PSVRuntimeInfo(StringRef D)
ViewArray< uint32_t > getInputPatchMap() const
ViewArray< uint32_t > getOutputVectorMasks(size_t Idx) const
uint32_t getVersion() const
uint32_t getSigElementStride() const
SigElementArray getSigPatchOrPrimElements() const
SigElementArray getSigInputElements() const
uint32_t getResourceCount() const
uint8_t getInputVectorCount() const
uint8_t getSigOutputCount() const
SigElementArray getSigOutputElements() const
const InfoStruct & getInfo() const
ViewArray< uint32_t > getPatchOutputMap() const
const T * getInfoAs() const
ViewArray< dxbc::ProgramSignatureElement >::iterator begin() const
Error initialize(StringRef Part)
ViewArray< dxbc::ProgramSignatureElement >::iterator end() const
StringRef getName(uint32_t Offset) const
@ C
The default llvm calling convention, compatible with C.
std::enable_if_t< std::is_arithmetic< T >::value, void > swapBytes(T &value)
constexpr bool IsBigEndianHost
void swapByteOrder(T &Value)
This is an optimization pass for GlobalISel generic memory operations.
bool operator!=(const iterator I)
iterator(const ViewArray &A, const char *C)
bool operator==(const iterator I)
iterator(const iterator &)=default
static constexpr uint32_t MaxStride()
ViewArray(StringRef D, size_t S)