Skip to content

Runtime: GetResourceAllocationInfo implementation and host comparison test - #450

Closed
ray3242 wants to merge 1 commit into
ItsNotRexed:mainfrom
ray3242:feat/getresourceallocationinfo-comparison-test
Closed

ray3242 wants to merge 1 commit into
ItsNotRexed:mainfrom
ray3242:feat/getresourceallocationinfo-comparison-test

Conversation

@ray3242

@ray3242 ray3242 commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Implements ID3D12Device::GetResourceAllocationInfo in the Vulkan-backed device (d3d12_vulkan_device.cpp), following D3D12's rules for size and alignment computation for buffers and textures (2D, 3D, MSAA, depth-stencil, BC formats).

Adds a comparison test (compare_allocation_info in d3d12_vulkan_device_test.cpp) that validates the implementation against the host PC D3D12 runtime for a comprehensive set of resource descriptions: buffers, 2D textures with various formats and mip counts, MSAA render targets and depth buffers, and volume textures. Follows the same pattern as the existing GetCopyableFootprints comparison test.

No game data, no GPU required for the implementation. The comparison test requires Windows and a D3D12-capable GPU.

AI-assisted (Claude Code).

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

… test

Implements ID3D12Device::GetResourceAllocationInfo in the Vulkan-backed device
(d3d12_vulkan_device.cpp), following D3D12's rules for size and alignment
computation for buffers and textures (2D, 3D, MSAA, depth-stencil, BC formats).

Adds a comparison test (compare_allocation_info in d3d12_vulkan_device_test.cpp)
that validates the implementation against the host PC D3D12 runtime for a
comprehensive set of resource descriptions: buffers, 2D textures with various
formats and mip counts, MSAA render targets and depth buffers, and volume
textures. Follows the same pattern as the existing GetCopyableFootprints
comparison test.

No game data, no GPU required for the implementation. The comparison test
requires Windows and a D3D12-capable GPU.

AI-assisted (Claude Code).
@kotorvr

kotorvr commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 068a215 on RTX 4090 (driver 621.14), Windows 11 26200, MSVC 19.44: build fails. This comes from the PR, not a flake.

A clean RelWithDebInfo Ninja build of runtime/ (Vulkan SDK 1.4.363.0) stops in two places:

runtime/shims/d3d12_vulkan_device.cpp(634): error C3668: ...Device::GetResourceAllocationInfo': method with override specifier 'override' did not override any base class methods
runtime/test/d3d12_vulkan_device_test.cpp(221): error C2664: ...ID3D12Device::GetResourceAllocationInfo(UINT,UINT,const D3D12_RESOURCE_DESC *)': cannot convert argument 2 from 'const D3D12_RESOURCE_DESC *' to 'UINT'

The SDK declares D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfo(UINT visibleMask, UINT numResourceDescs, const D3D12_RESOURCE_DESC*), which returns the struct. The PR declares (UINT, const D3D12_RESOURCE_DESC*, D3D12_RESOURCE_ALLOCATION_INFO*). With that signature the override doesn't match, and neither do the test's calls GetResourceAllocationInfo(1, &c.desc, &a).

Also, GetResourceAllocationInfo is already on main from #327 (D3D-23), which is likely why this PR conflicts. After a rebase, maybe only the host-comparison test is still needed.

No game files used. AI-assisted run (Claude Code).

@ray3242

ray3242 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Superseded: GetResourceAllocationInfo/1 are implemented on current main in runtime/shims/d3d12_vulkan_device.cpp (verified with git grep). Closing this stale conflicting PR; the work is already upstream.

@ray3242 ray3242 closed this Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants