3 Commits

Author SHA1 Message Date
Justin Bogner
72017fcf00 [DirectX] Only embed dxil when writing object files
When emitting assembly we don't particularly want the binary DXIL
embedded in the output. This was mostly there for testing purposes, so
we update those tests to run the test directly using `opt` and
restrict the -dxil-embed and -dxil-globals passes to running normally
only in the case where we're trying to emit a DXContainer.

Differential Revision: https://reviews.llvm.org/D158051
2023-08-16 13:12:32 -07:00
Xiang Li
78a73dda60 [DirectX backend] PartSize not include PartHeader
PartSize for a part in dx container is only the size of the content of the part, not include size of the PartHeader.

Differential Revision: https://reviews.llvm.org/D141207
2023-01-09 19:10:21 -05:00
Chris Bieneman
c861ea8736 Generate DXIL Shader hash
DXIL shader bitcode is hashed and the hash is placed into the final
output object file in its own data part.

This change modifies the DXContainerGlobals pass to compute the shader
hash (just an MD5 of the bitcode) and put the shader hash data into a
global for the HASH part.

This also sets the hash flag as appropriate for if the hashed shader
contained debug information. There is additional handling required to
get debug information in shaders working correctly with our tooling,
but that will be addressed in subsequent patches.

Reviewed By: python3kgae

Differential Revision: https://reviews.llvm.org/D139357
2022-12-07 15:22:55 -06:00