Repository navigation
D3D12.X: release the interface returned by QueryInterface - #1156
gloger2003 wants to merge 1 commit into
Conversation
The DRED wrapper can return a different interface pointer. Dispatch Release through that pointer so the debug layer receives the matching interface. Assisted-by: OpenAI Codex (GPT-6)
|
Independent verification on current Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.
AI use: test runs by Devin (Cognition, SWE-2); no code changes. |
|
A regression run under Wine on Linux, on a retail title. Tested
Regression run main (first run): this PR: The last Not tested
AI use
|
…vall#1142, ivall#1150, ivall#1156, ivall#1182, ivall#1191, ivall#1195, ivall#1221 Integrate 10 high-impact open upstream PRs on top of upstream/main (930e8b4): - ivall#1182: share video memory across render targets aliased onto one physical page (~1.85-2.1 GB VRAM saved) - ivall#1142: declare tiled texture pools texture-only (D3D12_HEAP_FLAG_DENY_BUFFERS) for vkd3d-proton - ivall#1097: report process memory under Wine via PagefileUsage fallback - ivall#1078: bound BCPack record scratch memory to 2 KiB stack batches - ivall#1150: convert console clear-value formats in CreatePlacedResource - ivall#1156: release the interface returned by QueryInterface in class_for - ivall#1139: check pointer alignment in is_adopted before dereferencing - ivall#1195: skip ExecuteIndirect dispatch of untranslated console compute pipelines - ivall#1191: VirtualProtect commits lazy pages in its range first - ivall#1221: unmark lazy away mappings in FreeTitlePhysicalPages Assisted-by: Antigravity (Google DeepMind)
…ll#1221, and updated Linux PRs Update fork README for upstream/main 930e8b4 (BCPack BC1-BC7, XCL_PSO_WAIT_MS, low-VA ASLR < 2^40, alloc_pool, sparse tile parking/pool reuse, direct page moves, write-watch merge), newly integrated PRs (ivall#1078, ivall#1097, ivall#1139, ivall#1142, ivall#1150, ivall#1156, ivall#1182, ivall#1191, ivall#1195, ivall#1221), and updated Linux PRs (ivall#867, ivall#871, ivall#877). Assisted-by: Antigravity (Google DeepMind)
|
Tested on Setup: RTX 5090 32 GB, NVIDIA 621.14 (32.0.16.2114), Ryzen 7 9800X3D, Windows 11 23H2 (10.0.22631.6199), inbox Tested
On the If you want the GPU check in the PR, here it is ( //! The D3D12 debug layer (`XCL_D3D12_DEBUG=1`) with DRED (`XCL_DRED=1`): making a command list,
//! the runtime makes DRED's breadcrumb buffer through the device's CreatePlacedResource – XCL's
//! hook – and gets back its own inner resource, which XCL adopts. Its QueryInterface answers
//! with the debug layer's object, which must be released through its own vtable.
use windows::core::Interface;
use windows::Win32::Graphics::Direct3D12::*;
use xcl::gpu::recomp::runner;
use xcl::hle::d3d12x::real;
#[test]
fn command_list_with_debug_layer_and_dred() {
std::env::set_var("XCL_UMA_MB", "64");
std::env::set_var("XCL_D3D12_DEBUG", "1");
std::env::set_var("XCL_DRED", "1");
if xcl::hle::d3d12x::backend() != xcl::hle::d3d12x::Backend::Real {
return runner::skip_test("no GPU");
}
let raw = real::device_raw();
let dev = unsafe { ID3D12Device::from_raw_borrowed(&raw) }.expect("backend device").clone();
if dev.cast::<ID3D12InfoQueue>().is_err() {
return runner::skip_test("no D3D12 debug layer (Graphics Tools)");
}
unsafe {
let alloc: ID3D12CommandAllocator = dev.CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT).expect("allocator");
let list: ID3D12GraphicsCommandList = dev.CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, &alloc, None).expect("command list");
list.Close().expect("Close");
alloc.Reset().expect("allocator Reset");
list.Reset(&alloc, None).expect("list Reset");
list.Close().expect("second Close");
}
}Not tested
AI use: omp with Claude Opus 5.5 ran the tests above on the machine named, wrote the GPU check and this report; no code changes to this PR. |
|
Test report: this PR fixes the start-up crash with Setup: RTX 5070 Ti 16 GB (driver 610.88), Ryzen 7 9700X, Windows 11 Pro 26300, rustc 1.97.0, release. A retail title, on a local integration branch based on
Not tested: AI use: Claude Code (Claude Opus 5.5) ran the runs and cdb on the machine above and wrote this report. |
|
NVIDIA startup validation of this fix, encountered while diagnosing A newer retail game. Hardware: Ryzen 7 9800X3D, RTX 3060 12 GB (621.14), approximately 16 GB RAM, Windows 11 Home 26200; Rust 1.95.0 MSVC, DXC/DXIL 1.9.2602.17. Before: local integration After: cherry-picked only Validation on the integrated tree:
This is not a clean main/PR-head smoke pair. Both sides also contained the same optional local input harness and a wrapping-arithmetic correction in the reference branch's texture-upload test-data generator. No assertions were weakened. No game data, dumps or screenshots are attached. AI use: Codex, GPT-6 (exact serving variant not exposed), investigated the failure, integrated the existing patch, ran these commands and wrote this report. The interface fix remains its original author's work. |
D3D12 interface discovery now releases the reference through the interface returned by QueryInterface. In the DRED and debug-layer configuration, that pointer can belong to a different wrapper.
What is in it
Tested
Regression run
Minecraft Preview 1.18.3064.0, normal D3D12 mode with identical 1x game profiles.
main:
PR:
Not tested
AI use