Generate DXIL Shader hash
authorChris Bieneman <chris.bieneman@me.com>
Mon, 5 Dec 2022 20:21:41 +0000 (14:21 -0600)
committerChris Bieneman <chris.bieneman@me.com>
Wed, 7 Dec 2022 21:22:55 +0000 (15:22 -0600)
commitc861ea8736bd8e624f8de6ab9ace90994744fa54
tree2ad613d18d75f74995961a3a02fa6c7f65b6bf89
parentf2f8f7095323988523efeba854dfc667542b0d0b
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
llvm/lib/Target/DirectX/DXContainerGlobals.cpp
llvm/test/CodeGen/DirectX/ContainerData/DebugShaderHash.ll [new file with mode: 0644]
llvm/test/CodeGen/DirectX/ContainerData/ShaderHash.ll [new file with mode: 0644]