[DX] Fix PSV resource serialization
authorChris Bieneman <chris.bieneman@me.com>
Tue, 18 Jul 2023 00:33:16 +0000 (19:33 -0500)
committerChris Bieneman <chris.bieneman@me.com>
Wed, 19 Jul 2023 23:01:01 +0000 (18:01 -0500)
commit5fdf8605102014825dc79e1859f218228dbcd15f
treed3800cf76b18675300c3d0a817f7ae6093421620
parentf385abf131e01b12b14ac3bc7214eb119b40523e
[DX] Fix PSV resource serialization

When writing this initially I missed including the resource stride.
This change adds the resources stride to the serialized value.

I've also extended the testing and error reporting around parsing PSV
information. This adds tests to verify that the reader produces
meaningful error messages for malformed DXContainer files, and a test
that verifies the resource stride is respected in the reader even if
the stride isn't an expected or known value (as would happen if the
format changes in the future).

This is part of #59479.

Reviewed By: bogner, bob80905

Differential Revision: https://reviews.llvm.org/D155143
31 files changed:
llvm/include/llvm/Object/DXContainer.h
llvm/include/llvm/ObjectYAML/DXContainerYAML.h
llvm/lib/MC/DXContainerPSVInfo.cpp
llvm/lib/Object/DXContainer.cpp
llvm/lib/ObjectYAML/DXContainerYAML.cpp
llvm/test/ObjectYAML/DXContainer/PSVv0-amplification.yaml
llvm/test/ObjectYAML/DXContainer/PSVv0-compute.yaml
llvm/test/ObjectYAML/DXContainer/PSVv0-domain.yaml
llvm/test/ObjectYAML/DXContainer/PSVv0-geometry.yaml
llvm/test/ObjectYAML/DXContainer/PSVv0-hull.yaml
llvm/test/ObjectYAML/DXContainer/PSVv0-mesh.yaml
llvm/test/ObjectYAML/DXContainer/PSVv0-pixel.yaml
llvm/test/ObjectYAML/DXContainer/PSVv0-vertex.yaml
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-hull.yaml
llvm/test/ObjectYAML/DXContainer/PSVv1-mesh.yaml
llvm/test/ObjectYAML/DXContainer/PSVv1-pixel.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-hull.yaml
llvm/test/ObjectYAML/DXContainer/PSVv2-mesh.yaml
llvm/test/ObjectYAML/DXContainer/PSVv2-pixel.yaml
llvm/test/ObjectYAML/DXContainer/PSVv2-vertex.yaml
llvm/tools/obj2yaml/dxcontainer2yaml.cpp
llvm/unittests/Object/DXContainerTest.cpp