This is an archive of the discontinued LLVM Phabricator instance.

[ObjectYAML] Add support for DXContainer HASH
ClosedPublic

Authored by beanz on Oct 24 2022, 11:48 AM.

Details

Summary

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.

Diff Detail

Event Timeline

beanz created this revision.Oct 24 2022, 11:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 24 2022, 11:48 AM
beanz requested review of this revision.Oct 24 2022, 11:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 24 2022, 11:48 AM
python3kgae added inline comments.Oct 25 2022, 11:43 AM
llvm/include/llvm/ObjectYAML/DXContainerYAML.h
70

Why use vector here when the size is always 16?

beanz added inline comments.Oct 25 2022, 12:39 PM
llvm/include/llvm/ObjectYAML/DXContainerYAML.h
70

We can't bind yaml traits to statically sized arrays because YAML doesn't have statically sized arrays.

python3kgae added inline comments.Oct 25 2022, 2:26 PM
llvm/lib/BinaryFormat/DXContainer.cpp
28

add const to Zeros?

29

Why do we want to set Digest to Zeros when Flags is 0?

beanz added inline comments.Oct 25 2022, 2:35 PM
llvm/lib/BinaryFormat/DXContainer.cpp
29

This doesn't set, it compares. If flags and the digest are all zero'd it wasn't populated, so we can omit it from the textual YAML output.

python3kgae accepted this revision.Oct 25 2022, 2:48 PM
This revision is now accepted and ready to land.Oct 25 2022, 2:48 PM
This revision was automatically updated to reflect the committed changes.