Repository navigation
d3d12: ID3D12Heap::GetDesc drops CREATE_NOT_ZEROED and CREATE_NOT_RESIDENT, as the host does - #8500
MartinIndra02 wants to merge 1 commit into
Conversation
…IDENT, as the host does The host runtime reads a heap's flags back without the two creation-only bits (measured on an RTX 3080, 621.24); the layer returned them as given. GetDesc now masks them, as GetHeapProperties already does; the stored description keeps them. d3d12_heap_properties_test records each placed resource's heap GetDesc (flags, size, alignment) against the host and checks the layer's on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested 4ef39f3 on Windows 11: pass on both Vulkan adapters. Each run compared all 651 heap-property values with the default Windows D3D12 device. Both runs had zero mismatches.
I built I built the same test against parent dde82f2. Both adapters failed at the same check. For a buffer-only heap created with AI-assisted. |
|
Tested
AI-assisted. |
|
Independent native check (RTX 4070 Ti SUPER / 621.14, and WARP: identical) agrees with the mask in
Committed buffers: AI-assisted (Claude Code). |
|
Tested
Synthetic test only, no game files. AI-assisted (Claude). |
Claimed in the coordination issue as: #8344 (comment)
Depends on: none
What and why
ID3D12Heap::GetDescon the Vulkan-backed device (Heap::GetDesc,runtime/shims/d3d12_vulkan_device.cpp:2602) returned the heap flags exactly asCreateHeapgot them. The host runtime drops the two creation-only flags,D3D12_HEAP_FLAG_CREATE_NOT_ZEROED(0x1000) andD3D12_HEAP_FLAG_CREATE_NOT_RESIDENT(0x800), and keeps the rest. Measured on an RTX 3080 (621.24) with a heap of 64 KiB:CreateHeapGetDesc().FlagsCREATE_NOT_ZEROEDCREATE_NOT_RESIDENTALLOW_ONLY_BUFFERS | CREATE_NOT_ZEROEDSHAREDALLOW_SHADER_ATOMICSID3D12Resource::GetHeapPropertiesalready drops the same two bits (resolved_heap_flags).GetDescnow masks them too. The stored descriptiondesc_keeps them for the layer's own use (#7559 readsCREATE_NOT_ZEROEDfrom it). The only internal caller of a heap'sGetDesc, ind3d12_com.cpp, readsSizeInBytesand nothing else.runtime/test/d3d12_heap_properties_test.cppnow also records each placed resource's heapGetDesc(Flags, SizeInBytes, Alignment) and compares it with the host. It adds three placed cases: a heap withCREATE_NOT_RESIDENT, one with both creation-only flags, and one withALLOW_SHADER_ATOMICS, which must be kept. Without a host, the test still fails if the layer's heap reports a creation-only flag.No overlap: #5808 changes the
CreateHeaprefusals (heap_desc_refusal), #2590 addsID3D12Heap1next toGetDesc, and #7559 changes the heap constructor. None of them touchesHeap::GetDesc.Tested
Windows 11 x64, MSVC 19.44.35220, NVIDIA GeForce RTX 3080 (driver 621.24 / 32.0.16.2124), RelWithDebInfo + Ninja.
d3d12_heap_properties_test, before the fix: fails withheap properties placed buffer, DEFAULT heap, CREATE_NOT_ZEROED: heap Flags: 0x10c0 keeps a creation-only flag(exit 1). After:651 values compared with the host (0 more not compared), 0 mismatches,d3d12_heap_properties_test: OK(exit 0).d3d12_node_mask_test: descriptor heap GetDesc 8 of 8 and command queue GetDesc 6 of 6 match; exit 0.d3d12_placed_dimensions_test: 82 answers compared, 0 differ; exit 0.d3d12_vulkan_device_test: stops only at the knownline 6574: tiles == 1failure, as onmain(d3d12_depth_resolve: check refused resolves against a destination cleared in its own list (#6610 follow-up) #7905, d3d12_depth_resolve_test: a refused resolve reads the destination through lists that run #7909). Every host comparison before that line reports 0 mismatches.python -I scripts/check_no_game_data.pyon both changed files andgit diff --checkare clean.AI-assisted: yes (Claude Code)
Checklist
docs/design.md, with how it was confirmed.🤖 Generated with Claude Code