This is an archive of the discontinued LLVM Phabricator instance.

Generate DXIL Shader hash
ClosedPublic

Authored by beanz on Dec 5 2022, 12:22 PM.

Details

Summary

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.

Diff Detail

Event Timeline

beanz created this revision.Dec 5 2022, 12:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 5 2022, 12:22 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
beanz requested review of this revision.Dec 5 2022, 12:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 5 2022, 12:22 PM
beanz updated this revision to Diff 480208.Dec 5 2022, 12:47 PM

Need to byte-swap the hash structure on big endian hosts so that it is encoded as little-endian.

python3kgae accepted this revision.Dec 6 2022, 9:23 AM
This revision is now accepted and ready to land.Dec 6 2022, 9:23 AM
This revision was landed with ongoing or failed builds.Dec 7 2022, 1:26 PM
This revision was automatically updated to reflect the committed changes.