summaryrefslogtreecommitdiff
path: root/llvm/lib/BinaryFormat/DXContainer.cpp
AgeCommit message (Collapse)Author
2025-10-06[DirectX] Fix Flags validation to prevent casting into enum (#161587)joaosaffran
This PR changes the validation logic for Root Descriptor and Descriptor Range flags to properly check if the `uint32_t` values are within range before casting into the enums.
2025-10-06[NFC][DirectX] Moving IsValidXYZ Functions to cpp file (#161896)joaosaffran
Originally, DXContainer `isValid...` functions were defined din the header. That cause a problem, that made this specific file huge, since every function also includes a `def` file. To fix this problem, this PR moves the function to the cpp equivalent file. Closes: [158162](https://github.com/llvm/llvm-project/issues/158162)
2025-09-26[DirectX] Updating DXContainer Yaml to represent Root Signature 1.2 (#159659)joaosaffran
This PR updates the YAML representation of DXContainer to support Root Signature 1.2, this also requires updating the write logic to support testing.
2025-08-14[DirectX] Add Range Overlap validation (#152229)joaosaffran
As part of the Root Signature Spec, we need to validate if Root Signatures are not defining overlapping ranges. Closes: https://github.com/llvm/llvm-project/issues/126645 --------- Co-authored-by: joaosaffran <joao.saffran@microsoft.com> Co-authored-by: Joao Saffran <{ID}+{username}@users.noreply.github.com> Co-authored-by: Joao Saffran <jderezende@microsoft.com>
2025-08-07[NFC][HLSL][DirectX] Consolidate `ResourceClassNames` (#152213)Finn Plummer
During the split of the various `Frontend/HLSL` libraries, there was an oversight to duplicate the `ResourceClassNames` definitions. This commit simply consolidates the definitions into `DXContainer.h` as `getResourceClasses`
2025-07-03[NFC][HLSL][DirectX] Let `HLSLRootSignature` reuse the `dxbc` defined enums ↵Finn Plummer
(#145986) This pr removes the redundancy of having the same enums defined in both the front-end and back-end of handling root signatures. Since there are many more uses of the enum in the front-end of the code, we will adhere to the naming conventions used in the front-end, to minimize the diff. The macros in `DXContainerConstants.def` are also touched-up to be consistent and to have each macro name follow its respective definition in d3d12.h and searchable by name [here](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/). Additionally, the many `getEnumNames` are moved to `DXContainer` from `HLSLRootSignatureUtils` as they we will want them to be exposed publicly anyways. Changes for each enum follow the pattern of a commit that will make the enum definition in `DXContainer` adhere to above listed naming conventions, followed by a commit to actually use that enum in the front-end. Resolves https://github.com/llvm/llvm-project/issues/145815
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>
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
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-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
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[NFC] Refactor DXContainer to support more partsChris Bieneman
This patch refactors some of the DXContainer Object and YAML code to make it easier to add more part parsing. DXContainer has a whole bunch of constant values, so I've added a DXContainerConstants.def file which will grow with constant definitions, but starts with just part identifiers. I've also added a utility to parse the part magic string into an enum, and converted the code to use that utility and the enum instead of the part literal string. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D133980