summaryrefslogtreecommitdiff
path: root/llvm/lib/ObjectYAML/DXContainerEmitter.cpp
AgeCommit message (Collapse)Author
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-15[NFC] Refactoring MCDXBC to support out of order storage of root parameters ↵joaosaffran
(#137284) This PR refactors mcdxbc data structure for root signatures to support out of order storage of in memory root signature data. closes: #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-05-11[DirectX] Replace bitfield version in ProgramHeader. (#91797)Xiang Li
Avoid using bitfield in dxbc::ProgramHeader. It could potentially be read incorrectly on any host depending on the compiler. From [C++17's [class.bit]](https://timsong-cpp.github.io/cppwp/n4659/class.bit#1) > Bit-fields are packed into some addressable allocation unit. [ Note: Bit-fields straddle allocation units on some machines and not on others. Bit-fields are assigned right-to-left on some machines, left-to-right on others.  — end note ] For #91793
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>
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-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-12-17std::optional::value => operator*/operator->Fangrui Song
value() has undesired exception checking semantics and calls __throw_bad_optional_access in libc++. Moreover, the API is unavailable without _LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS). This fixes check-llvm.
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-07-13[llvm] Use value instead of getValue (NFC)Kazu Hirata
2022-06-25Revert "Don't use Optional::hasValue (NFC)"Kazu Hirata
This reverts commit aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.
2022-06-25Don't use Optional::hasValue (NFC)Kazu Hirata
2022-06-07[DX][ObjYAML] Zero out unused fields that get written to the output fileBenjamin Kramer
Found by msan
2022-06-06Fix big endian build botsChris Bieneman
Another case of reading a value from a struct that has been byte swapped to write out. This should address the failure on the ppcbe bot.
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-01Fix DXContainer test on ppcbeChris Bieneman
Silly mistake, the code here was byteswapping in-place which corrupts the data structure that is used later to write the correct file.
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