Repository navigation
Runtime: GetResourceAllocationInfo on the Vulkan device (D3D-23) - #327
Conversation
GetResourceAllocationInfo, GetResourceAllocationInfo1 and GetResourceAllocationInfo2 were generated stubs. Buffers take their width rounded up to 64 KiB. A texture's size is what its VkImage needs (vkGetDeviceImageMemoryRequirements, or a throwaway image without it), rounded up to its D3D12 alignment: 64 KiB, 4 MiB with MSAA, or the small alignment the description asks for. A 4 KiB request that doesn't qualify is invalid, as on the PC runtime; the MSAA 64 KiB one has no size limit there. Texture creation and these queries share one VkImageCreateInfo. d3d12_vulkan_device_test compares buffer sizes, alignments and invalid descriptions with the host PC runtime, and checks the per-resource layout of the Device4/Device8 variants. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested 257e385 on NVIDIA RTX 5070 Ti, driver 621.24, Windows 11 26200: pass (allocation info matches the host runtime except the documented BC1 case; validation exit 1 is an unrelated loader message, details below). Independent GPU test: head Built with
The validation process exits 1 only because the harness counts one loader ERROR about a missing Epic EOS overlay JSON. That message appears in every validation run on this machine, including a build derived from main, and is unrelated to this PR. So the RTX 3070 results carry to Blackwell / driver 621.24, including the one BC1 size difference you noted. Synthetic fixtures only; AI-assisted testing. |
|
Tested 257e385 on RTX 4090 (driver 621.14), Windows 11 26200, MSVC 19.44: pass
No game files used. AI-assisted run (Claude Code). |
D3D-23 in #313 (claimed in #156 as a new item):
GetResourceAllocationInfo,GetResourceAllocationInfo1andGetResourceAllocationInfo2on the Vulkan device (docs/d3d12_vulkan.md§4.1).Depends on: #278
Depends on: #288
Depends on: #291
Depends on: #295
Depends on: #317
Depends on: #328
Depends on: #329
Depends on: #335
(None of these is needed for this PR to work. Each one conflicts with it in git, checked with
git merge-treeagainst every open PR that touches the same files, counting only conflicts this branch adds on top of what the PR already has withmain. All are ind3d12_vulkan_device.cpp,d3d12_vulkan_device_test.cppordocs/d3d12_vulkan.md, and they're mechanical: newDeviceStatemembers, newDevicemethods, new test functions. #286 and #157 already conflict withmainind3d12_vulkan_device.cpp, so I'll re-check them after they rebase. I'll rebase onto whichever lands first.)What and why
All three were generated stubs. Applications call them to size and align resources before suballocating heaps (
CreateHeapandCreatePlacedResource), and the Xbox proxy's slot 25 forwards to the first one.VkImageneeds, rounded up to the texture's D3D12 alignment. It comes fromvkGetDeviceImageMemoryRequirements(Vulkan 1.3 orVK_KHR_maintenance4), or from a throwaway image if the device has neither.VkImageCreateInfobuilder (texture_create_info). The size reported is the size later allocated.UINT64_MAX), not answered with 64 KiB.1/2also fill each resource's offset, size and alignment. Any invalid description makes the whole answer invalid.SizeInBytes = UINT64_MAX. That covers a bad buffer shape or format, a zero or oversized extent, an alignment other than the ones above, an unsupported MSAA shape, a format or usage the GPU can't make (checked withvkGetPhysicalDeviceImageFormatPropertiesfirst, so nothing invalid reaches Vulkan), and sampler-feedback descriptions in2.Tested
Windows 11, NVIDIA GeForce RTX 3070 (driver 610.88), Vulkan SDK 1.4.363.0, MSVC 14.44 (VS 2022), rebased on
8bd0087. No game files.cmake --build runtime/build --config RelWithDebInfo: builds with no warnings.ctest -C RelWithDebInfo: 15/15.d3d12_vulkan_device_testwithLEONIDA_VK_VALIDATION=1: passes with no validation errors.1/2give the same per-resource layout as single calls, and an invalid entry makes the list invalid on both runtimes.(The validation run disables two third-party overlay layers on this PC through
VK_LOADER_LAYERS_DISABLE. They aren't part of the test.)Checklist
docs/design.md, with how it was confirmed. (Not applicable: no translator change.)AI-assisted (Claude Code).
🤖 Generated with Claude Code