Repository navigation
Runtime: ID3D12Resource::GetDesc fills in a defaulted Alignment, as the host does - #781
Merged
Merged
Conversation
…he host does A resource created with Alignment 0 read back Alignment 0 from the Vulkan-backed device. The PC runtime and WARP report the placement alignment instead: 64 KiB, or 4 MiB for a multisampled texture, and keep one the description asked for. d3d12_resource_desc_test compares every GetDesc field of 26 committed and reserved descriptions with the default adapter and WARP. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: a new D3D item, claim in #634 (no ID assigned yet). Builds on
mainonly; noDepends on.What and why
Resource::GetDescinruntime/shims/d3d12_vulkan_device.cppreturned the description as it was passed in, apart fromMipLevels0. A resource created withAlignment0 therefore read backAlignment0. The PC runtime reports the placement alignment instead:GetDesc().Alignmenton the hostAlignment0Alignment0Code that aligns by
GetDesc().Alignment, or hands the description on toGetResourceAllocationInfoor a placed resource, got 0 from the layer.GetDescnow fills the field in the same way. The stored description is unchanged, so nothing else in the layer sees a different value.New test
runtime/test/d3d12_resource_desc_test.cpp(built with the other host comparison tests, run explicitly, not in CTest): it creates 26 committed and reserved descriptions on the layer and on Windows D3D12 (the default adapter and WARP, whichever exist) and compares everyGetDescfield. A description the host refuses is skipped; one only the layer refuses is listed and not compared (1D textures today, D3D-63).docs/d3d12_vulkan.mdsection 4.2 andruntime/README.mddescribe the behaviour and the test.Tested
Windows 10 Pro 19045 (host
d3d12.dll10.0.19041), NVIDIA GeForce RTX 3060, driver 596.36, MSVC 14.44, onmain67204bf.d3d12_resource_desc_test: 25 of 26 descriptions match the RTX 3060 host and 25 of 26 match WARP, 0 differ; the 26th is the 1D texture the layer does not create yet.Alignmentis the only field that differs in all 40 pairs.ctest: 27 of 29 pass, the same asmainwithout this change. The two failures are the known Windows 10 ones:d3d12_vulkan_device(host footprints for an unaligned BC1 texture, TEST-97 / tests: keep d3d12_vulkan_device_test running on Windows 10 (TEST-97) #717) andbvh_builder(noID3D12Device11on this host, bvh_builder_test: skip with a reason when the host D3D12 device has no ID3D12Device11 (Windows 10, #688) (TEST-96) #721).d3d12_com_test,d3d12_gcl8_test,d3d12_uav_clear_test,d3d12_method_variants_test,d3d12_sampler2_test,d3d12_descriptor_test,d3d12_typeless_rtv_test) exit 0 with and without the change.d3d12_clear_testexits 1 with and without it (an R8G8B8A8 tie-rounding byte against WARP, D3D-45 / Runtime: clears match WARP on every format class: tie rounding, and the SNORM/SINT/R8/R16 formats (D3D-45) #521).LEONIDA_VK_VALIDATION=1: 0 validation messages in every test above. This PC has a stale implicit overlay layer manifest, so onmaineach run counts one loader error (TEST-98); for the validation pass I applied GPU tests: count only validation-type errors (TEST-98, @Ryx69's 3732227) #764'svk_test_device.hchange locally. It is not part of this PR.Not tested: AMD and Intel GPUs, and a Windows 11 host. No game files were used.
AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (Not a translator change.)🤖 Generated with Claude Code