diff --git a/llvm/include/llvm/BinaryFormat/DXContainer.h b/llvm/include/llvm/BinaryFormat/DXContainer.h --- a/llvm/include/llvm/BinaryFormat/DXContainer.h +++ b/llvm/include/llvm/BinaryFormat/DXContainer.h @@ -15,6 +15,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/Support/SwapByteOrder.h" +#include "llvm/TargetParser/Triple.h" #include @@ -36,6 +37,12 @@ namespace dxbc { +inline Triple::EnvironmentType getShaderStage(uint32_t Kind) { + assert(Kind <= Triple::Amplification - Triple::Pixel && + "Shader kind out of expected range."); + return static_cast(Triple::Pixel + Kind); +} + struct Hash { uint8_t Digest[16]; }; @@ -142,6 +149,208 @@ PartType parsePartType(StringRef S); +struct VertexPSVInfo { + uint8_t OutputPositionPresent; + uint8_t Unused[3]; + + void swapBytes() { + // nothing to swap + } +}; + +struct HullPSVInfo { + uint32_t InputControlPointCount; + uint32_t OutputControlPointCount; + uint32_t TessellatorDomain; + uint32_t TessellatorOutputPrimitive; + + void swapBytes() { + sys::swapByteOrder(InputControlPointCount); + sys::swapByteOrder(OutputControlPointCount); + sys::swapByteOrder(TessellatorDomain); + sys::swapByteOrder(TessellatorOutputPrimitive); + } +}; + +struct DomainPSVInfo { + uint32_t InputControlPointCount; + uint8_t OutputPositionPresent; + uint8_t Unused[3]; + uint32_t TessellatorDomain; + + void swapBytes() { + sys::swapByteOrder(InputControlPointCount); + sys::swapByteOrder(TessellatorDomain); + } +}; + +struct GeometryPSVInfo { + uint32_t InputPrimitive; + uint32_t OutputTopology; + uint32_t OutputStreamMask; + uint8_t OutputPositionPresent; + uint8_t Unused[3]; + + void swapBytes() { + sys::swapByteOrder(InputPrimitive); + sys::swapByteOrder(OutputTopology); + sys::swapByteOrder(OutputStreamMask); + } +}; + +struct PixelPSVInfo { + uint8_t DepthOutput; + uint8_t SampleFrequency; + uint8_t Unused[2]; + + void swapBytes() { + // nothing to swap + } +}; + +struct MeshPSVInfo { + uint32_t GroupSharedBytesUsed; + uint32_t GroupSharedBytesDependentOnViewID; + uint32_t PayloadSizeInBytes; + uint16_t MaxOutputVertices; + uint16_t MaxOutputPrimitives; + + void swapBytes() { + sys::swapByteOrder(GroupSharedBytesUsed); + sys::swapByteOrder(GroupSharedBytesDependentOnViewID); + sys::swapByteOrder(PayloadSizeInBytes); + sys::swapByteOrder(MaxOutputVertices); + sys::swapByteOrder(MaxOutputPrimitives); + } +}; + +struct AmplificationPSVInfo { + uint32_t PayloadSizeInBytes; + + void swapBytes() { sys::swapByteOrder(PayloadSizeInBytes); } +}; + +union PipelinePSVInfo { + VertexPSVInfo VS; + HullPSVInfo HS; + DomainPSVInfo DS; + GeometryPSVInfo GS; + PixelPSVInfo PS; + MeshPSVInfo MS; + AmplificationPSVInfo AS; + + void swapBytes(Triple::EnvironmentType Stage) { + switch (Stage) { + case Triple::EnvironmentType::Pixel: + PS.swapBytes(); + break; + case Triple::EnvironmentType::Vertex: + VS.swapBytes(); + break; + case Triple::EnvironmentType::Geometry: + GS.swapBytes(); + break; + case Triple::EnvironmentType::Hull: + HS.swapBytes(); + break; + case Triple::EnvironmentType::Domain: + DS.swapBytes(); + break; + case Triple::EnvironmentType::Mesh: + MS.swapBytes(); + break; + case Triple::EnvironmentType::Amplification: + AS.swapBytes(); + break; + default: + break; + } + } +}; + +static_assert(sizeof(PipelinePSVInfo) == 4 * sizeof(uint32_t), + "Pipeline-specific PSV info must fit in 16 bytes."); + +namespace PSV { + +namespace v0 { +struct RuntimeInfo { + PipelinePSVInfo StageInfo; + uint32_t MinimumWaveLaneCount; // minimum lane count required, 0 if unused + uint32_t MaximumWaveLaneCount; // maximum lane count required, + // 0xffffffff if unused + void swapBytes() { + // Skip the union because we don't know which field it has + sys::swapByteOrder(MinimumWaveLaneCount); + sys::swapByteOrder(MaximumWaveLaneCount); + } + + void swapBytes(Triple::EnvironmentType Stage) { StageInfo.swapBytes(Stage); } +}; + +} // namespace v0 + +namespace v1 { + +struct MeshRuntimeInfo { + uint8_t SigPrimVectors; // Primitive output for MS + uint8_t MeshOutputTopology; +}; + +union GeometryExtraInfo { + uint16_t MaxVertexCount; // MaxVertexCount for GS only (max 1024) + uint8_t SigPatchConstOrPrimVectors; // Output for HS; Input for DS; + // Primitive output for MS (overlaps + // MeshInfo::SigPrimVectors) + MeshRuntimeInfo MeshInfo; +}; +struct RuntimeInfo : public v0::RuntimeInfo { + uint8_t ShaderStage; // PSVShaderKind + uint8_t UsesViewID; + GeometryExtraInfo GeomData; + + // PSVSignatureElement counts + uint8_t SigInputElements; + uint8_t SigOutputElements; + uint8_t SigPatchConstOrPrimElements; + + // Number of packed vectors per signature + uint8_t SigInputVectors; + uint8_t SigOutputVectors[4]; + + void swapBytes() { + // nothing to swap since everything is single-byte or a union field + } + + void swapBytes(Triple::EnvironmentType Stage) { + v0::RuntimeInfo::swapBytes(Stage); + if (Stage == Triple::EnvironmentType::Geometry) + sys::swapByteOrder(GeomData.MaxVertexCount); + } +}; + +} // namespace v1 + +namespace v2 { +struct RuntimeInfo : public v1::RuntimeInfo { + uint32_t NumThreadsX; + uint32_t NumThreadsY; + uint32_t NumThreadsZ; + + void swapBytes() { + sys::swapByteOrder(NumThreadsX); + sys::swapByteOrder(NumThreadsY); + sys::swapByteOrder(NumThreadsZ); + } + + void swapBytes(Triple::EnvironmentType Stage) { + v1::RuntimeInfo::swapBytes(Stage); + } +}; + +} // namespace v2 +} // namespace PSV + } // namespace dxbc } // namespace llvm diff --git a/llvm/include/llvm/BinaryFormat/DXContainerConstants.def b/llvm/include/llvm/BinaryFormat/DXContainerConstants.def --- a/llvm/include/llvm/BinaryFormat/DXContainerConstants.def +++ b/llvm/include/llvm/BinaryFormat/DXContainerConstants.def @@ -3,6 +3,7 @@ CONTAINER_PART(DXIL) CONTAINER_PART(SFI0) CONTAINER_PART(HASH) +CONTAINER_PART(PSV0) #undef CONTAINER_PART #endif diff --git a/llvm/include/llvm/MC/DXContainerPSVInfo.h b/llvm/include/llvm/MC/DXContainerPSVInfo.h new file mode 100644 --- /dev/null +++ b/llvm/include/llvm/MC/DXContainerPSVInfo.h @@ -0,0 +1,44 @@ +//===- llvm/MC/DXContainerPSVInfo.h - DXContainer PSVInfo -*- C++ -------*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_MC_DXCONTAINERPSVINFO_H +#define LLVM_MC_DXCONTAINERPSVINFO_H + +#include "llvm/BinaryFormat/DXContainer.h" + +#include +#include +#include + +namespace llvm { + +class raw_ostream; + +namespace mcdxbc { +// This data structure is a helper for reading and writing PSV RuntimeInfo data. +// It is implemented in the BinaryFormat library so that it can be used by both +// the MC layer and Object tools. +// This structure is used to represent the extracted data in an inspectable and +// modifiable format, and can be used to serialize the data back into valid PSV +// RuntimeInfo. +struct PSVRuntimeInfo { + dxbc::PSV::v2::RuntimeInfo BaseData; + + // Serialize PSVInfo into the provided raw_ostream. The version field + // specifies the data version to encode, the default value specifies encoding + // the highest supported version. + void write(raw_ostream &OS, + uint32_t Version = std::numeric_limits::max()) const; + + void swapBytes() { BaseData.swapBytes(); } +}; + +} // namespace mcdxbc +} // namespace llvm + +#endif // LLVM_MC_DXCONTAINERPSVINFO_H diff --git a/llvm/include/llvm/Object/DXContainer.h b/llvm/include/llvm/Object/DXContainer.h --- a/llvm/include/llvm/Object/DXContainer.h +++ b/llvm/include/llvm/Object/DXContainer.h @@ -20,9 +20,40 @@ #include "llvm/BinaryFormat/DXContainer.h" #include "llvm/Support/Error.h" #include "llvm/Support/MemoryBufferRef.h" +#include "llvm/TargetParser/Triple.h" namespace llvm { namespace object { + +namespace DirectX { +class PSVRuntimeInfo { + StringRef Data; + uint32_t Size; + uint32_t ResourceCount; + using InfoStruct = + std::variant; + InfoStruct BasicInfo; + +public: + PSVRuntimeInfo(StringRef D) : Data(D), Size(0), ResourceCount(0) {} + + // Parsing depends on the shader kind + Error parse(uint16_t ShaderKind); + + uint32_t getSize() const { return Size; } + uint32_t getResourceCount() const { return ResourceCount; } + uint32_t getVersion() const { + return Size >= sizeof(dxbc::PSV::v2::RuntimeInfo) + ? 2 + : (Size >= sizeof(dxbc::PSV::v1::RuntimeInfo) ? 1 : 0); + } + + const InfoStruct &getInfo() const { return BasicInfo; } +}; + +} // namespace DirectX + class DXContainer { public: using DXILData = std::pair; @@ -36,12 +67,14 @@ std::optional DXIL; std::optional ShaderFlags; std::optional Hash; + std::optional PSVInfo; Error parseHeader(); Error parsePartOffsets(); Error parseDXILHeader(StringRef Part); Error parseShaderFlags(StringRef Part); Error parseHash(StringRef Part); + Error parsePSVInfo(StringRef Part); friend class PartIterator; public: @@ -118,11 +151,15 @@ const dxbc::Header &getHeader() const { return Header; } - std::optional getDXIL() const { return DXIL; } + const std::optional &getDXIL() const { return DXIL; } std::optional getShaderFlags() const { return ShaderFlags; } std::optional getShaderHash() const { return Hash; } + + const std::optional &getPSVInfo() const { + return PSVInfo; + }; }; } // namespace object diff --git a/llvm/include/llvm/ObjectYAML/DXContainerYAML.h b/llvm/include/llvm/ObjectYAML/DXContainerYAML.h --- a/llvm/include/llvm/ObjectYAML/DXContainerYAML.h +++ b/llvm/include/llvm/ObjectYAML/DXContainerYAML.h @@ -71,6 +71,20 @@ std::vector Digest; }; +struct PSVInfo { + // The version field isn't actually encoded in the file, but it is inferred by + // the size of data regions. We include it in the yaml because it simplifies + // the format. + uint32_t Version; + + dxbc::PSV::v2::RuntimeInfo Info; + + PSVInfo(); + PSVInfo(const dxbc::PSV::v0::RuntimeInfo *P, uint16_t Stage); + PSVInfo(const dxbc::PSV::v1::RuntimeInfo *P); + PSVInfo(const dxbc::PSV::v2::RuntimeInfo *P); +}; + struct Part { Part() = default; Part(std::string N, uint32_t S) : Name(N), Size(S) {} @@ -79,6 +93,7 @@ std::optional Program; std::optional Flags; std::optional Hash; + std::optional Info; }; struct Object { @@ -116,6 +131,10 @@ static void mapping(IO &IO, DXContainerYAML::ShaderHash &Hash); }; +template <> struct MappingTraits { + static void mapping(IO &IO, DXContainerYAML::PSVInfo &PSV); +}; + template <> struct MappingTraits { static void mapping(IO &IO, DXContainerYAML::Part &Version); }; diff --git a/llvm/lib/MC/CMakeLists.txt b/llvm/lib/MC/CMakeLists.txt --- a/llvm/lib/MC/CMakeLists.txt +++ b/llvm/lib/MC/CMakeLists.txt @@ -1,5 +1,6 @@ add_llvm_component_library(LLVMMC ConstantPools.cpp + DXContainerPSVInfo.cpp ELFObjectWriter.cpp MCAsmBackend.cpp MCAsmInfo.cpp diff --git a/llvm/lib/MC/DXContainerPSVInfo.cpp b/llvm/lib/MC/DXContainerPSVInfo.cpp new file mode 100644 --- /dev/null +++ b/llvm/lib/MC/DXContainerPSVInfo.cpp @@ -0,0 +1,33 @@ +//===- llvm/MC/DXContainerPSVInfo.cpp - DXContainer PSVInfo -----*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "llvm/MC/DXContainerPSVInfo.h" +#include "llvm/BinaryFormat/DXContainer.h" +#include "llvm/Support/raw_ostream.h" + +using namespace llvm; +using namespace llvm::mcdxbc; + +void PSVRuntimeInfo::write(raw_ostream &OS, uint32_t Version) const { + uint32_t InfoSize; + switch (Version) { + case 0: + InfoSize = sizeof(dxbc::PSV::v0::RuntimeInfo); + break; + case 1: + InfoSize = sizeof(dxbc::PSV::v1::RuntimeInfo); + break; + case 2: + default: + InfoSize = sizeof(dxbc::PSV::v2::RuntimeInfo); + } + // Write the size of the info. + OS.write(reinterpret_cast(&InfoSize), sizeof(uint32_t)); + // Write the info itself. + OS.write(reinterpret_cast(&BaseData), InfoSize); +} diff --git a/llvm/lib/Object/DXContainer.cpp b/llvm/lib/Object/DXContainer.cpp --- a/llvm/lib/Object/DXContainer.cpp +++ b/llvm/lib/Object/DXContainer.cpp @@ -91,6 +91,15 @@ return Error::success(); } +Error DXContainer::parsePSVInfo(StringRef Part) { + if (PSVInfo) + return parseFailed("More than one PSV0 part is present in the file"); + PSVInfo = DirectX::PSVRuntimeInfo(Part); + // Parsing the PSVRuntime info occurs late because we need to read data from + // other parts first. + return Error::success(); +} + Error DXContainer::parsePartOffsets() { uint32_t LastOffset = sizeof(dxbc::Header) + (Header.PartCount * sizeof(uint32_t)); @@ -140,10 +149,24 @@ if (Error Err = parseHash(PartData)) return Err; break; + case dxbc::PartType::PSV0: + if (Error Err = parsePSVInfo(PartData)) + return Err; + break; case dxbc::PartType::Unknown: break; } } + + // Fully parsing the PSVInfo requires knowing the shader kind which we read + // out of the program header in the DXIL part. + if (PSVInfo) { + if (!DXIL) + return parseFailed("Cannot fully parse pipeline state validation " + "information without DXIL part."); + if (Error Err = PSVInfo->parse(DXIL->first.ShaderKind)) + return Err; + } return Error::success(); } @@ -166,3 +189,45 @@ StringRef(Current + sizeof(dxbc::PartHeader), IteratorState.Part.Size); IteratorState.Offset = Offset; } + +Error DirectX::PSVRuntimeInfo::parse(uint16_t ShaderKind) { + Triple::EnvironmentType ShaderStage = dxbc::getShaderStage(ShaderKind); + + const char *Current = Data.begin(); + if (Error Err = readInteger(Data, Current, Size)) + return Err; + Current += sizeof(uint32_t); + + StringRef PSVInfoData = Data.substr(sizeof(uint32_t), Size); + + using namespace dxbc::PSV; + + const uint32_t PSVVersion = getVersion(); + + // Detect the PSVVersion by looking at the size field. + if (PSVVersion == 2) { + v2::RuntimeInfo Info; + if (Error Err = readStruct(PSVInfoData, Current, Info)) + return Err; + if (sys::IsBigEndianHost) + Info.swapBytes(ShaderStage); + BasicInfo = Info; + } else if (PSVVersion == 1) { + v1::RuntimeInfo Info; + if (Error Err = readStruct(PSVInfoData, Current, Info)) + return Err; + if (sys::IsBigEndianHost) + Info.swapBytes(ShaderStage); + BasicInfo = Info; + } else { + v0::RuntimeInfo Info; + if (Error Err = readStruct(PSVInfoData, Current, Info)) + return Err; + if (sys::IsBigEndianHost) + Info.swapBytes(ShaderStage); + BasicInfo = Info; + } + Current += Size; + + return Error::success(); +} diff --git a/llvm/lib/ObjectYAML/DXContainerEmitter.cpp b/llvm/lib/ObjectYAML/DXContainerEmitter.cpp --- a/llvm/lib/ObjectYAML/DXContainerEmitter.cpp +++ b/llvm/lib/ObjectYAML/DXContainerEmitter.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/BinaryFormat/DXContainer.h" +#include "llvm/MC/DXContainerPSVInfo.h" #include "llvm/ObjectYAML/ObjectYAML.h" #include "llvm/ObjectYAML/yaml2obj.h" #include "llvm/Support/Errc.h" @@ -193,6 +194,17 @@ OS.write(reinterpret_cast(&Hash), sizeof(dxbc::ShaderHash)); break; } + case dxbc::PartType::PSV0: { + if (!P.Info.has_value()) + continue; + mcdxbc::PSVRuntimeInfo PSV; + memcpy(&PSV.BaseData, &P.Info->Info, sizeof(dxbc::PSV::v2::RuntimeInfo)); + + if (sys::IsBigEndianHost) + PSV.swapBytes(); + PSV.write(OS, P.Info->Version); + break; + } case dxbc::PartType::Unknown: break; // Skip any handling for unrecognized parts. } diff --git a/llvm/lib/ObjectYAML/DXContainerYAML.cpp b/llvm/lib/ObjectYAML/DXContainerYAML.cpp --- a/llvm/lib/ObjectYAML/DXContainerYAML.cpp +++ b/llvm/lib/ObjectYAML/DXContainerYAML.cpp @@ -43,6 +43,35 @@ memcpy(Digest.data(), &Data.Digest[0], 16); } +DXContainerYAML::PSVInfo::PSVInfo() : Version(0) { + memset(&Info, 0, sizeof(Info)); +} + +DXContainerYAML::PSVInfo::PSVInfo(const dxbc::PSV::v0::RuntimeInfo *P, + uint16_t Stage) + : Version(0) { + memset(&Info, 0, sizeof(Info)); + memcpy(&Info, P, sizeof(dxbc::PSV::v0::RuntimeInfo)); + + assert(Stage < std::numeric_limits::max() && + "Stage should be a very small number"); + // We need to bring the stage in separately since it isn't part of the v1 data + // structure. + Info.ShaderStage = static_cast(Stage); +} + +DXContainerYAML::PSVInfo::PSVInfo(const dxbc::PSV::v1::RuntimeInfo *P) + : Version(1) { + memset(&Info, 0, sizeof(Info)); + memcpy(&Info, P, sizeof(dxbc::PSV::v1::RuntimeInfo)); +} + +DXContainerYAML::PSVInfo::PSVInfo(const dxbc::PSV::v2::RuntimeInfo *P) + : Version(2) { + memset(&Info, 0, sizeof(Info)); + memcpy(&Info, P, sizeof(dxbc::PSV::v2::RuntimeInfo)); +} + namespace yaml { void MappingTraits::mapping( @@ -84,6 +113,103 @@ IO.mapRequired("Digest", Hash.Digest); } +void MappingTraits::mapping( + IO &IO, DXContainerYAML::PSVInfo &PSV) { + IO.mapRequired("Version", PSV.Version); + + // Shader stage is only included in binaries for v1 and later, but we always + // include it since it simplifies parsing and file construction. + IO.mapRequired("ShaderStage", PSV.Info.ShaderStage); + + dxbc::PipelinePSVInfo &StageInfo = PSV.Info.StageInfo; + Triple::EnvironmentType Stage = dxbc::getShaderStage(PSV.Info.ShaderStage); + + switch (Stage) { + case Triple::EnvironmentType::Pixel: + IO.mapRequired("DepthOutput", StageInfo.PS.DepthOutput); + IO.mapRequired("SampleFrequency", StageInfo.PS.SampleFrequency); + break; + case Triple::EnvironmentType::Vertex: + IO.mapRequired("OutputPositionPresent", StageInfo.VS.OutputPositionPresent); + break; + case Triple::EnvironmentType::Geometry: + IO.mapRequired("InputPrimitive", StageInfo.GS.InputPrimitive); + IO.mapRequired("OutputTopology", StageInfo.GS.OutputTopology); + IO.mapRequired("OutputStreamMask", StageInfo.GS.OutputStreamMask); + IO.mapRequired("OutputPositionPresent", StageInfo.GS.OutputPositionPresent); + break; + case Triple::EnvironmentType::Hull: + IO.mapRequired("InputControlPointCount", + StageInfo.HS.InputControlPointCount); + IO.mapRequired("OutputControlPointCount", + StageInfo.HS.OutputControlPointCount); + IO.mapRequired("TessellatorDomain", StageInfo.HS.TessellatorDomain); + IO.mapRequired("TessellatorOutputPrimitive", + StageInfo.HS.TessellatorOutputPrimitive); + break; + case Triple::EnvironmentType::Domain: + IO.mapRequired("InputControlPointCount", + StageInfo.DS.InputControlPointCount); + IO.mapRequired("OutputPositionPresent", StageInfo.DS.OutputPositionPresent); + IO.mapRequired("TessellatorDomain", StageInfo.DS.TessellatorDomain); + break; + case Triple::EnvironmentType::Mesh: + IO.mapRequired("GroupSharedBytesUsed", StageInfo.MS.GroupSharedBytesUsed); + IO.mapRequired("GroupSharedBytesDependentOnViewID", + StageInfo.MS.GroupSharedBytesDependentOnViewID); + IO.mapRequired("PayloadSizeInBytes", StageInfo.MS.PayloadSizeInBytes); + IO.mapRequired("MaxOutputVertices", StageInfo.MS.MaxOutputVertices); + IO.mapRequired("MaxOutputPrimitives", StageInfo.MS.MaxOutputPrimitives); + break; + case Triple::EnvironmentType::Amplification: + IO.mapRequired("PayloadSizeInBytes", StageInfo.AS.PayloadSizeInBytes); + break; + default: + break; + } + + IO.mapRequired("MinimumWaveLaneCount", PSV.Info.MinimumWaveLaneCount); + IO.mapRequired("MaximumWaveLaneCount", PSV.Info.MaximumWaveLaneCount); + + if (PSV.Version == 0) + return; + + IO.mapRequired("UsesViewID", PSV.Info.UsesViewID); + + switch (Stage) { + case Triple::EnvironmentType::Geometry: + IO.mapRequired("MaxVertexCount", PSV.Info.GeomData.MaxVertexCount); + break; + case Triple::EnvironmentType::Hull: + case Triple::EnvironmentType::Domain: + IO.mapRequired("SigPatchConstOrPrimVectors", + PSV.Info.GeomData.SigPatchConstOrPrimVectors); + break; + case Triple::EnvironmentType::Mesh: + IO.mapRequired("SigPrimVectors", PSV.Info.GeomData.MeshInfo.SigPrimVectors); + IO.mapRequired("MeshOutputTopology", + PSV.Info.GeomData.MeshInfo.MeshOutputTopology); + break; + default: + break; + } + + IO.mapRequired("SigInputElements", PSV.Info.SigInputElements); + IO.mapRequired("SigOutputElements", PSV.Info.SigOutputElements); + IO.mapRequired("SigPatchConstOrPrimElements", + PSV.Info.SigPatchConstOrPrimElements); + IO.mapRequired("SigInputVectors", PSV.Info.SigInputVectors); + MutableArrayRef Vec(PSV.Info.SigOutputVectors); + IO.mapRequired("SigOutputVectors", Vec); + + if (PSV.Version == 1) + return; + + IO.mapRequired("NumThreadsX", PSV.Info.NumThreadsX); + IO.mapRequired("NumThreadsY", PSV.Info.NumThreadsY); + IO.mapRequired("NumThreadsZ", PSV.Info.NumThreadsZ); +} + void MappingTraits::mapping(IO &IO, DXContainerYAML::Part &P) { IO.mapRequired("Name", P.Name); @@ -91,6 +217,7 @@ IO.mapOptional("Program", P.Program); IO.mapOptional("Flags", P.Flags); IO.mapOptional("Hash", P.Hash); + IO.mapOptional("PSVInfo", P.Info); } void MappingTraits::mapping( diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-amplification.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-amplification.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-amplification.yaml @@ -0,0 +1,39 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 0 + ShaderStage: 14 + PayloadSizeInBytes: 4092 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 14 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 0 +# CHECK-NEXT: ShaderStage: 14 +# CHECK-NEXT: PayloadSizeInBytes: 4092 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-compute.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-compute.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-compute.yaml @@ -0,0 +1,37 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 0 + ShaderStage: 5 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 5 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 0 +# CHECK-NEXT: ShaderStage: 5 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-domain.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-domain.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-domain.yaml @@ -0,0 +1,43 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 0 + ShaderStage: 4 + InputControlPointCount: 1024 + OutputPositionPresent: 1 + TessellatorDomain: 2056 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 4 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 0 +# CHECK-NEXT: ShaderStage: 4 +# CHECK-NEXT: InputControlPointCount: 1024 +# CHECK-NEXT: OutputPositionPresent: 1 +# CHECK-NEXT: TessellatorDomain: 2056 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-geometry.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-geometry.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-geometry.yaml @@ -0,0 +1,45 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 0 + ShaderStage: 2 + InputPrimitive: 1024 + OutputTopology: 4096 + OutputStreamMask: 2056 + OutputPositionPresent: 1 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 2 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 0 +# CHECK-NEXT: ShaderStage: 2 +# CHECK-NEXT: InputPrimitive: 1024 +# CHECK-NEXT: OutputTopology: 4096 +# CHECK-NEXT: OutputStreamMask: 2056 +# CHECK-NEXT: OutputPositionPresent: 1 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-hull.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-hull.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-hull.yaml @@ -0,0 +1,45 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 0 + ShaderStage: 3 + InputControlPointCount: 1024 + OutputControlPointCount: 4096 + TessellatorDomain: 2056 + TessellatorOutputPrimitive: 8192 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 3 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 0 +# CHECK-NEXT: ShaderStage: 3 +# CHECK-NEXT: InputControlPointCount: 1024 +# CHECK-NEXT: OutputControlPointCount: 4096 +# CHECK-NEXT: TessellatorDomain: 2056 +# CHECK-NEXT: TessellatorOutputPrimitive: 8192 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-mesh.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-mesh.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-mesh.yaml @@ -0,0 +1,47 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 0 + ShaderStage: 13 + GroupSharedBytesUsed: 1024 + GroupSharedBytesDependentOnViewID: 2056 + PayloadSizeInBytes: 4092 + MaxOutputVertices: 8196 + MaxOutputPrimitives: 4092 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 13 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 0 +# CHECK-NEXT: ShaderStage: 13 +# CHECK-NEXT: GroupSharedBytesUsed: 1024 +# CHECK-NEXT: GroupSharedBytesDependentOnViewID: 2056 +# CHECK-NEXT: PayloadSizeInBytes: 4092 +# CHECK-NEXT: MaxOutputVertices: 8196 +# CHECK-NEXT: MaxOutputPrimitives: 4092 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-pixel.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-pixel.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-pixel.yaml @@ -0,0 +1,41 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 0 + ShaderStage: 0 + DepthOutput: 7 + SampleFrequency: 96 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 0 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 0 +# CHECK-NEXT: ShaderStage: 0 +# CHECK-NEXT: DepthOutput: 7 +# CHECK-NEXT: SampleFrequency: 96 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv0-vertex.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv0-vertex.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv0-vertex.yaml @@ -0,0 +1,39 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 0 + ShaderStage: 1 + OutputPositionPresent: 1 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 1 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 0 +# CHECK-NEXT: ShaderStage: 1 +# CHECK-NEXT: OutputPositionPresent: 1 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-amplification.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-amplification.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-amplification.yaml @@ -0,0 +1,51 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 1 + ShaderStage: 14 + PayloadSizeInBytes: 4092 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 14 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 1 +# CHECK-NEXT: ShaderStage: 14 +# CHECK-NEXT: PayloadSizeInBytes: 4092 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-compute.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-compute.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-compute.yaml @@ -0,0 +1,49 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 1 + ShaderStage: 5 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 5 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 1 +# CHECK-NEXT: ShaderStage: 5 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-domain.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-domain.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-domain.yaml @@ -0,0 +1,57 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 1 + ShaderStage: 4 + InputControlPointCount: 1024 + OutputPositionPresent: 1 + TessellatorDomain: 2056 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + SigPatchConstOrPrimVectors: 128 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 4 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 1 +# CHECK-NEXT: ShaderStage: 4 +# CHECK-NEXT: InputControlPointCount: 1024 +# CHECK-NEXT: OutputPositionPresent: 1 +# CHECK-NEXT: TessellatorDomain: 2056 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: SigPatchConstOrPrimVectors: 128 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-geometry.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-geometry.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-geometry.yaml @@ -0,0 +1,59 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 1 + ShaderStage: 2 + InputPrimitive: 1024 + OutputTopology: 4096 + OutputStreamMask: 2056 + OutputPositionPresent: 1 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + MaxVertexCount: 4096 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 2 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 1 +# CHECK-NEXT: ShaderStage: 2 +# CHECK-NEXT: InputPrimitive: 1024 +# CHECK-NEXT: OutputTopology: 4096 +# CHECK-NEXT: OutputStreamMask: 2056 +# CHECK-NEXT: OutputPositionPresent: 1 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: MaxVertexCount: 4096 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-hull.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-hull.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-hull.yaml @@ -0,0 +1,59 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 1 + ShaderStage: 3 + InputControlPointCount: 1024 + OutputControlPointCount: 4096 + TessellatorDomain: 2056 + TessellatorOutputPrimitive: 8192 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + SigPatchConstOrPrimVectors: 128 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 3 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 1 +# CHECK-NEXT: ShaderStage: 3 +# CHECK-NEXT: InputControlPointCount: 1024 +# CHECK-NEXT: OutputControlPointCount: 4096 +# CHECK-NEXT: TessellatorDomain: 2056 +# CHECK-NEXT: TessellatorOutputPrimitive: 8192 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: SigPatchConstOrPrimVectors: 128 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-mesh.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-mesh.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-mesh.yaml @@ -0,0 +1,63 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 1 + ShaderStage: 13 + GroupSharedBytesUsed: 1024 + GroupSharedBytesDependentOnViewID: 2056 + PayloadSizeInBytes: 4092 + MaxOutputVertices: 8196 + MaxOutputPrimitives: 4092 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + SigPrimVectors: 128 + MeshOutputTopology: 16 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 13 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 1 +# CHECK-NEXT: ShaderStage: 13 +# CHECK-NEXT: GroupSharedBytesUsed: 1024 +# CHECK-NEXT: GroupSharedBytesDependentOnViewID: 2056 +# CHECK-NEXT: PayloadSizeInBytes: 4092 +# CHECK-NEXT: MaxOutputVertices: 8196 +# CHECK-NEXT: MaxOutputPrimitives: 4092 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: SigPrimVectors: 128 +# CHECK-NEXT: MeshOutputTopology: 16 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-pixel.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-pixel.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-pixel.yaml @@ -0,0 +1,53 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 1 + ShaderStage: 0 + DepthOutput: 7 + SampleFrequency: 96 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 0 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 1 +# CHECK-NEXT: ShaderStage: 0 +# CHECK-NEXT: DepthOutput: 7 +# CHECK-NEXT: SampleFrequency: 96 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv1-vertex.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv1-vertex.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv1-vertex.yaml @@ -0,0 +1,51 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 1 + ShaderStage: 1 + OutputPositionPresent: 1 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 1 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 1 +# CHECK-NEXT: ShaderStage: 1 +# CHECK-NEXT: OutputPositionPresent: 1 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-amplification.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-amplification.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-amplification.yaml @@ -0,0 +1,57 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 2 + ShaderStage: 14 + PayloadSizeInBytes: 4092 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + NumThreadsX: 512 + NumThreadsY: 1024 + NumThreadsZ: 2048 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 14 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 2 +# CHECK-NEXT: ShaderStage: 14 +# CHECK-NEXT: PayloadSizeInBytes: 4092 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: NumThreadsX: 512 +# CHECK-NEXT: NumThreadsY: 1024 +# CHECK-NEXT: NumThreadsZ: 2048 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-compute.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-compute.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-compute.yaml @@ -0,0 +1,55 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 2 + ShaderStage: 5 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + NumThreadsX: 512 + NumThreadsY: 1024 + NumThreadsZ: 2048 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 5 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 2 +# CHECK-NEXT: ShaderStage: 5 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: NumThreadsX: 512 +# CHECK-NEXT: NumThreadsY: 1024 +# CHECK-NEXT: NumThreadsZ: 2048 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-domain.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-domain.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-domain.yaml @@ -0,0 +1,63 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 2 + ShaderStage: 4 + InputControlPointCount: 1024 + OutputPositionPresent: 1 + TessellatorDomain: 2056 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + SigPatchConstOrPrimVectors: 128 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + NumThreadsX: 512 + NumThreadsY: 1024 + NumThreadsZ: 2048 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 4 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 2 +# CHECK-NEXT: ShaderStage: 4 +# CHECK-NEXT: InputControlPointCount: 1024 +# CHECK-NEXT: OutputPositionPresent: 1 +# CHECK-NEXT: TessellatorDomain: 2056 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: SigPatchConstOrPrimVectors: 128 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: NumThreadsX: 512 +# CHECK-NEXT: NumThreadsY: 1024 +# CHECK-NEXT: NumThreadsZ: 2048 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-geometry.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-geometry.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-geometry.yaml @@ -0,0 +1,65 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 2 + ShaderStage: 2 + InputPrimitive: 1024 + OutputTopology: 4096 + OutputStreamMask: 2056 + OutputPositionPresent: 1 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + MaxVertexCount: 4096 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + NumThreadsX: 512 + NumThreadsY: 1024 + NumThreadsZ: 2048 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 2 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 2 +# CHECK-NEXT: ShaderStage: 2 +# CHECK-NEXT: InputPrimitive: 1024 +# CHECK-NEXT: OutputTopology: 4096 +# CHECK-NEXT: OutputStreamMask: 2056 +# CHECK-NEXT: OutputPositionPresent: 1 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: MaxVertexCount: 4096 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: NumThreadsX: 512 +# CHECK-NEXT: NumThreadsY: 1024 +# CHECK-NEXT: NumThreadsZ: 2048 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-hull.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-hull.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-hull.yaml @@ -0,0 +1,65 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 2 + ShaderStage: 3 + InputControlPointCount: 1024 + OutputControlPointCount: 4096 + TessellatorDomain: 2056 + TessellatorOutputPrimitive: 8192 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + SigPatchConstOrPrimVectors: 128 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + NumThreadsX: 512 + NumThreadsY: 1024 + NumThreadsZ: 2048 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 3 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 2 +# CHECK-NEXT: ShaderStage: 3 +# CHECK-NEXT: InputControlPointCount: 1024 +# CHECK-NEXT: OutputControlPointCount: 4096 +# CHECK-NEXT: TessellatorDomain: 2056 +# CHECK-NEXT: TessellatorOutputPrimitive: 8192 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: SigPatchConstOrPrimVectors: 128 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: NumThreadsX: 512 +# CHECK-NEXT: NumThreadsY: 1024 +# CHECK-NEXT: NumThreadsZ: 2048 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-mesh.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-mesh.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-mesh.yaml @@ -0,0 +1,69 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 2 + ShaderStage: 13 + GroupSharedBytesUsed: 1024 + GroupSharedBytesDependentOnViewID: 2056 + PayloadSizeInBytes: 4092 + MaxOutputVertices: 8196 + MaxOutputPrimitives: 4092 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + SigPrimVectors: 128 + MeshOutputTopology: 16 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + NumThreadsX: 512 + NumThreadsY: 1024 + NumThreadsZ: 2048 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 13 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 2 +# CHECK-NEXT: ShaderStage: 13 +# CHECK-NEXT: GroupSharedBytesUsed: 1024 +# CHECK-NEXT: GroupSharedBytesDependentOnViewID: 2056 +# CHECK-NEXT: PayloadSizeInBytes: 4092 +# CHECK-NEXT: MaxOutputVertices: 8196 +# CHECK-NEXT: MaxOutputPrimitives: 4092 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: SigPrimVectors: 128 +# CHECK-NEXT: MeshOutputTopology: 16 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: NumThreadsX: 512 +# CHECK-NEXT: NumThreadsY: 1024 +# CHECK-NEXT: NumThreadsZ: 2048 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-pixel.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-pixel.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-pixel.yaml @@ -0,0 +1,59 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 2 + ShaderStage: 0 + DepthOutput: 7 + SampleFrequency: 96 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + NumThreadsX: 512 + NumThreadsY: 1024 + NumThreadsZ: 2048 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 0 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 2 +# CHECK-NEXT: ShaderStage: 0 +# CHECK-NEXT: DepthOutput: 7 +# CHECK-NEXT: SampleFrequency: 96 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: NumThreadsX: 512 +# CHECK-NEXT: NumThreadsY: 1024 +# CHECK-NEXT: NumThreadsZ: 2048 +# CHECK-NEXT: Name diff --git a/llvm/test/ObjectYAML/DXContainer/PSVv2-vertex.yaml b/llvm/test/ObjectYAML/DXContainer/PSVv2-vertex.yaml new file mode 100644 --- /dev/null +++ b/llvm/test/ObjectYAML/DXContainer/PSVv2-vertex.yaml @@ -0,0 +1,57 @@ +# RUN: yaml2obj %s | obj2yaml | FileCheck %s + +--- !dxcontainer +Header: + Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ] + Version: + Major: 1 + Minor: 0 + PartCount: 2 +Parts: + - Name: PSV0 + Size: 144 + PSVInfo: + Version: 2 + ShaderStage: 1 + OutputPositionPresent: 1 + MinimumWaveLaneCount: 0 + MaximumWaveLaneCount: 4294967295 + UsesViewID: 128 + SigInputElements: 8 + SigOutputElements: 16 + SigPatchConstOrPrimElements: 32 + SigInputVectors: 64 + SigOutputVectors: [ 8, 16, 32, 64 ] + NumThreadsX: 512 + NumThreadsY: 1024 + NumThreadsZ: 2048 + - Name: DXIL + Size: 24 + Program: + MajorVersion: 6 + MinorVersion: 0 + ShaderKind: 1 + Size: 6 + DXILMajorVersion: 0 + DXILMinorVersion: 1 + DXILSize: 0 +... + +# CHECK: Name: PSV0 +# CHECK: PSVInfo: +# CHECK-NEXT: Version: 2 +# CHECK-NEXT: ShaderStage: 1 +# CHECK-NEXT: OutputPositionPresent: 1 +# CHECK-NEXT: MinimumWaveLaneCount: 0 +# CHECK-NEXT: MaximumWaveLaneCount: 4294967295 +# CHECK-NEXT: UsesViewID: 128 +# CHECK-NEXT: SigInputElements: 8 +# CHECK-NEXT: SigOutputElements: 16 +# CHECK-NEXT: SigPatchConstOrPrimElements: 32 +# CHECK-NEXT: SigInputVectors: 64 +# CHECK-NEXT: SigOutputVectors: [ 8, 16, 32, 64 ] +# CHECK-NEXT: NumThreadsX: 512 +# CHECK-NEXT: NumThreadsY: 1024 +# CHECK-NEXT: NumThreadsZ: 2048 +# CHECK-NEXT: Name diff --git a/llvm/tools/obj2yaml/dxcontainer2yaml.cpp b/llvm/tools/obj2yaml/dxcontainer2yaml.cpp --- a/llvm/tools/obj2yaml/dxcontainer2yaml.cpp +++ b/llvm/tools/obj2yaml/dxcontainer2yaml.cpp @@ -73,6 +73,24 @@ NewPart.Hash = DXContainerYAML::ShaderHash(*Hash); break; } + case dxbc::PartType::PSV0: { + const auto &PSVInfo = Container.getPSVInfo(); + if (!PSVInfo) + break; + if (const auto *P = + std::get_if(&PSVInfo->getInfo())) { + if (!Container.getDXIL()) + break; + NewPart.Info = + DXContainerYAML::PSVInfo(P, Container.getDXIL()->first.ShaderKind); + } else if (const auto *P = std::get_if( + &PSVInfo->getInfo())) + NewPart.Info = DXContainerYAML::PSVInfo(P); + else if (const auto *P = + std::get_if(&PSVInfo->getInfo())) + NewPart.Info = DXContainerYAML::PSVInfo(P); + break; + } case dxbc::PartType::Unknown: break; }