Repository navigation
GPU: GetDevice and the DXGI device hand out the device at every level - #249
Merged
Merged
Conversation
The device answers QueryInterface for ID3D12Device and for its newer levels (Grand Theft Auto VI creates it as ID3D12Device11). A device child's GetDevice and the DXGI device's QueryInterface knew only the first: asked for the device by the interface the title holds, they answered E_NOINTERFACE with a null pointer. Both now ask the device's own test (is_device). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
muhammed-aksoy
pushed a commit
to muhammed-aksoy/VIctory
that referenced
this pull request
Nov 24, 2026
edsuuu
referenced
this pull request
in edsuuu/VI-BR-PORT
Nov 24, 2026
… at every level Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Tested current PR head
The synthetic interface test verifies the COM-style lookup paths; the host check is conditional, and neither test runs a game or title. |
Closed
suirentakamura
referenced
this pull request
in suirentakamura/victory-suiren
Nov 24, 2026
GPU: GetDevice and the DXGI device hand out the device at every level
itsonlysimbo
pushed a commit
to itsonlysimbo/VIctory
that referenced
this pull request
Nov 24, 2026
…vels GPU: GetDevice and the DXGI device hand out the device at every level
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.
What
The device answers
QueryInterfaceforID3D12Deviceand for its newer levels,ID3D12Device1to8and11(device::is_device; Grand Theft Auto VI creates it asID3D12Device11). Two other ways to reach the device knew only the first interface:object::parent_device:ID3D12DeviceChild::GetDevice, slot 0x38 of every device child (fences, queues, lists, heaps, resources, pipelines, ..);dxgi::device_query:QueryInterfaceon the DXGI device, which "also answers for the D3D12 device".Asked for the device by any newer level, both returned
E_NOINTERFACEand a null pointer:That is the interface the title itself holds, so code that goes from an object back to its device asks with exactly that id; callers rarely check this result, since on the host it cannot fail for an interface the device has.
Both now use the device's own test.
is_devicebecomespub(crate); nothing else changes.I have not seen the title or its middleware make this call (I have no game files); it would show in the log as
unknown interfaceon a device child.Tested
Windows 11 Pro 10.0.26200, NVIDIA RTX 3080 Ti (driver 32.0.16.1656), rustc 1.98.1 (
x86_64-pc-windows-msvc), no game data.Two new unit tests in
device.rs:the_hosts_children_hand_out_newer_device_levels(Windows, needs a host device; I checked it did not take its no-GPU early return here): the reference. On the host device, a fence'sGetDeviceforID3D12Device5succeeds. Passes onmainand with the fix.the_device_is_found_at_every_level_through_others(no GPU): forID3D12Deviceand each of the nine newer ids, a fence'sGetDeviceand the DXGI device'sQueryInterfacereturnS_OKand the device. Control: asking the fence'sGetDevicefor an interface the device is not (the fence's own id) still returnsE_NOINTERFACEand nulls the pointer.Results:
main(d2a4bae) + the tests only:cargo test -p victory-gpu --lib device::tests: the second test fails at the first newer id (ID3D12Device1):left: -2147467262(E_NOINTERFACE),right: 0.cargo test -p victory-gpu --lib: 45 passed, 0 failed, 1 ignored.cargo clippy -p victory-gpu --tests: nothing in the three files.rustfmt --checkon them: clean.cargo xtask policy: 151 files ok.git merge-tree) with GPU: seek directly to private data on final release #153 and GPU: fence waits, direct memory-write wakes, queue timeline and host list pool #32, which changeobject.rs: clean.Not tested: a title run.
AI-assisted (Claude Code); the tests above were run on the machine described.
🤖 Generated with Claude Code