summaryrefslogtreecommitdiff
path: root/llvm/lib/ObjectYAML/DXContainerYAML.cpp
AgeCommit message (Collapse)Author
2025-06-24[DirectX] Fix order of `v2::DescriptorRange` (#145555)joaosaffran
As pointed in #145438, the order of elements in `v2::DescriptorRange` is wrong according to the root signature file format. This changes the order and updates the code and test to continue to pass. Closes: #145438 --------- Co-authored-by: joaosaffran <joao.saffran@microsoft.com>
2025-05-29[DirectX] Adding support for static samplers in yaml2obj/obj2yaml (#139963)joaosaffran
- Adds support for static samplers ins dxcontainer binary format. - Adds writing logic to mcdxbc - adds reading logic to Object - adds tests Closes: [126636](https://github.com/llvm/llvm-project/issues/126636) --------- Co-authored-by: joaosaffran <joao.saffran@microsoft.com>
2025-05-29[DirectX] adding support to read/write descriptor table data using ↵joaosaffran
obj2yaml/yaml2obj (#138315) Closes: https://github.com/orgs/llvm/projects/4/views/22?sliceBy%5Bvalue%5D=joaosaffran&pane=issue&itemId=97332852&issue=llvm%7Cllvm-project%7C126635 --------- Co-authored-by: joaosaffran <joao.saffran@microsoft.com>
2025-05-27[NFC] Updating RTS0 namespace to contain all elements related to it's ↵joaosaffran
representation (#141173) As requested in a previous PR, this change moves all structs related to RTS0 to RTS0 namespace. --------- Co-authored-by: joaosaffran <joao.saffran@microsoft.com>
2025-05-27[NFC] Refactoring DXContainerYaml Root Parameter representation (#138318)joaosaffran
This PR removes the union usage from `DXContainerYaml` Root Parameters representation, it uses variant instead. closes: [#139585](https://github.com/llvm/llvm-project/issues/139585) --------- Co-authored-by: joaosaffran <joao.saffran@microsoft.com>
2025-05-08[DirectX] Adding support for Root Descriptors in obj2yaml/yaml2obj (#137259)joaosaffran
closes: [126634](https://github.com/llvm/llvm-project/issues/126634) --------- Co-authored-by: joaosaffran <joao.saffran@microsoft.com>
2025-04-16[DirectX] adding support in obj2yaml and yaml2obj to root constants (#127840)joaosaffran
Adding support for Root Constant in MC, Object and obj2yaml and yaml2obj, this PR adds: - new structures to dxbc definition. - serialize and desirialize logic from dxcontainer to yaml - tests validating against dxc - adding support to multiple parts. Closes: https://github.com/llvm/llvm-project/issues/126633 --------- Co-authored-by: joaosaffran <joao.saffran@microsoft.com>
2025-02-13[DXIL] Add support for root signature flag element in DXContainer (#123147)joaosaffran
Adding support for Root Signature Flags Element extraction and writing to DXContainer. - Adding an analysis to deal with RootSignature metadata definition - Adding validation for Flag - writing RootSignature blob into DXIL Closes: [126632](https://github.com/llvm/llvm-project/issues/126632) --------- Co-authored-by: joaosaffran <joao.saffran@microsoft.com>
2025-02-07[DXIL] Adding support to RootSignatureFlags in obj2yaml (#122396)joaosaffran
This PR adds: - `RootSignatureFlags` extraction from DXContainer using `obj2yaml` This PR is part of: #121493 --------- Co-authored-by: joaosaffran <joao.saffran@microsoft.com>
2024-08-30[DirectX] Replace ResourceFlag enum with struct fields (#106617)Xiang Li
Remove the enum about ResourceFlag. Add struct ResourceFlags which save the resource flags with bool fields. This will get better yaml dump. For #103275
2024-08-29[DirectX] add enum for PSV resource type/kind/flag. (#106227)Xiang Li
Add ResourceType, ResourceKind and ResourceFlag enum class for PSV resource. This is for #103275
2024-03-25Add support for PSV EntryFunctionName (#86296)Cooper Partin
This change introduces a version 3 of the PSV data that includes support for the name of the entry function as an offset into StringTable data to a null-terminated utf-8 string. Additional tests were added to ensure that the new value was properly serialized/deserialized from object data. Fixes #80175 --------- Co-authored-by: Cooper Partin <coopp@ntdev.microsoft.com>
2024-03-21Revert "Add support for PSV EntryFunctionName (#84409)" (#86211)Cooper Partin
This reverts commit cde54df39cab3a1d60a3e1862ab341609bee3cc3. Co-authored-by: Cooper Partin <coopp@ntdev.microsoft.com>
2024-03-21Add support for PSV EntryFunctionName (#84409)Cooper Partin
This change introduces a version 3 of the PSV data that includes support for the name of the entry function as an offset into StringTable data to a null-terminated utf-8 string. Additional tests were added to ensure that the new value was properly serialized/deserialized from object data. Fixes #80175 --------- Co-authored-by: Cooper Partin <coopp@ntdev.microsoft.com>
2024-03-17[DirectX] Add DXIL_MODULE_FLAG for ShaderFlags. (#83217)Xiang Li
Add DXIL module flag bit offset for SHADER_FEATURE_FLAG. Added DXIL_MODULE_FLAG for DXIL module flag which does not have feature flag. Use DXILModuleFlags for ComputedShaderFlags instead of ShaderFeatureFlags. ComputedShaderFlags::getFeatureFlags() was added to get FeatureFlags. Rename DXContainerGlobals::getShaderFlags to DXContainerGlobals::getFeatureFlags. Fixes #57925
2024-02-27[DirectX][NFC] Rename ShaderFlag to SHADER_FEATURE_FLAG. (#82700)Xiang Li
This is preparation for add ShaderFlag in DXIL. For #57925
2023-10-05[DX] Add support for program signatures (#67346)Chris B
For DirectX, program signatures are encoded into three different binary sections depending on if the signature is for inputs, outputs, or patches. All three signature types use the same data structure encoding so they can share a lot of logic. This patch adds support for reading and writing program signature data as both yaml and binary data. Fixes #57743 and #57744
2023-09-15[DX] Support pipeline state masks (#66425)Chris B
The DXContainer pipeline state information encodes a bunch of mask vectors that are used to track things about the inputs and outputs from each shader. This adds support for reading and writing them throught he YAML test interfaces. The writing logic in MC is extremely primitive and we'll want to revisit the API for that, but since I'm not sure how we'll want to generate the mask bits from DXIL during code generation I didn't want to spend too much time on the API. Fixes #59479
2023-08-16Re-land [DX] Add support for PSV signature elementsChris Bieneman
The pipeline state data captured in the PSV0 section of the DXContainer file encodes signature elements which are read by the runtime to map inputs and outputs from the GPU program. This change adds support for generating and parsing signature elements with testing driven through the ObjectYAML tooling. Reviewed By: bogner Differential Revision: https://reviews.llvm.org/D157671 Initially landed as 8c567e64f808f7a818965c6bc123fedf7db7336f, and reverted in 4d800633b2683304a5431d002d8ffc40a1815520. ../llvm/include/llvm/BinaryFormat/DXContainerConstants.def ../llvm/test/ObjectYAML/DXContainer/PSVv1-amplification.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv1-compute.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv1-domain.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv1-geometry.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv1-vertex.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv2-amplification.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv2-compute.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv2-domain.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv2-geometry.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv2-vertex.yaml
2023-08-16Revert "[DX] Add support for PSV signature elements"Chris Bieneman
This reverts commit 8c567e64f808f7a818965c6bc123fedf7db7336f.
2023-08-16[DX] Add support for PSV signature elementsChris Bieneman
The pipeline state data captured in the PSV0 section of the DXContainer file encodes signature elements which are read by the runtime to map inputs and outputs from the GPU program. This change adds support for generating and parsing signature elements with testing driven through the ObjectYAML tooling. Reviewed By: bogner Differential Revision: https://reviews.llvm.org/D157671
2023-07-19[DX] Fix PSV resource serializationChris Bieneman
When writing this initially I missed including the resource stride. This change adds the resources stride to the serialized value. I've also extended the testing and error reporting around parsing PSV information. This adds tests to verify that the reader produces meaningful error messages for malformed DXContainer files, and a test that verifies the resource stride is respected in the reader even if the stride isn't an expected or known value (as would happen if the format changes in the future). This is part of #59479. Reviewed By: bogner, bob80905 Differential Revision: https://reviews.llvm.org/D155143
2023-02-02[DX] Add support for PSV resource bindingsChris Bieneman
This patch continues implementing DirectX pipeline state validation information by adding support for resource binding metadata. Reviewed By: python3kgae Differential Revision: https://reviews.llvm.org/D143130
2023-02-01[DX] Begin adding support for pipeline stateChris Bieneman
DirectX shader pipeline state validation information is a fairly complicated to serialize data structure. This patch adds the first bit of support for reading and writing the runtime info structure which comes first in the encoded data. Subsequent patches will flesh out the remaining fields of the data structure. There is no official documentation for the format, but the format is roughly documented in the code comment here: https://github.com/microsoft/DirectXShaderCompiler/blob/main/include/dxc /DxilContainer/DxilPipelineStateValidation.h#L731 Reviewed By: python3kgae Differential Revision: https://reviews.llvm.org/D141649
2022-10-27[ObjectYAML] Add support for DXContainer HASHChris Bieneman
DXContainer files contain a part that has an MD5 of the generated shader. This adds support to the ObjectYAML tooling to expand the hash part data and hash iteself in preparation for adding hashing support to DirectX code generation. Reviewed By: python3kgae Differential Revision: https://reviews.llvm.org/D136632
2022-09-29[DX] [ObjectYAML] Support DX shader feature flagsChris Bieneman
DXContainers contain a feature flag part, which stores a bitfield used to denote what underlying hardware features the shader requires. This change adds feature flags to the DXContainer YAML tooling to enable testing generating feature flags during HLSL code generation. Depends on D133980 Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D134315
2022-06-06[NFC] Fix spelling error M->LChris Bieneman
Clearly I cannot spell...
2022-06-06[DX][ObjYAML] Support for parsing DXIL partChris Bieneman
This patch adds support for parsing the DXIL part data into the ObjectYAML tooling. The DXIL part has additional headers describing the shader and bitcode data and stores serialized bitcode after the headers. Depends on D124945 Reviewed By: kuhar Differential Revision: https://reviews.llvm.org/D126795
2022-06-01[ObjectYAML][DX] Support yaml2dxcontainerChris Bieneman
This patch adds a the first bits of support for a yaml representation of dxcontainer files. Since the YAML representation's primary purpose is testing infrastructure, the yaml representation supports both verbose and a more friendly format by making computable sizes and offsets optional. If provided they are validated to be correct, otherwise they are computed on the fly during emission. As I expand the format I'll be able to make more size fields optional, and I will continue to make the format easier to work with. Depends on D124804 Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D124944