Files
mandy/runtime/test/fixtures/d3d12_xs_stub.cpp
kotorvr debda7e15d runtime tests: run a mapped stand-in through gta6rt --run into the Vulkan D3D12 device
tiny_frame imports d3d12_xs.dll!D3D12XboxCreateDevice from a link-time stub
and does the least a title does before its first frame: queue, allocator,
list, fence, an RTV heap with its start handle read in the console shape, a
committed target, a clear, a copy to a readback buffer, a fence wait, and a
check of every pixel. It returns from main with the device still alive.

run_tiny_frame runs it under gta6rt --run --trace-d3d12 with
LEONIDA_D3D12=vulkan; check_tiny_frame.py checks the verdict, the shim
binding and the call order, and exits 77 when d3d12_com_test, its probe,
finds no usable Vulkan device. tests/test_check_tiny_frame.py covers the
checker on synthetic output.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 20:24:40 +00:00

11 lines
483 B
C++

// Link-time stand-in for the console's d3d12_xs.dll, so tiny_frame.exe gets a real import of
// D3D12XboxCreateDevice. Under `gta6rt --run` the shim registry answers the import and this DLL never loads; it is
// built into a folder the loader does not search. Test code, not game content.
#include <windows.h>
#include <unknwn.h>
extern "C" HRESULT __stdcall D3D12XboxCreateDevice(IUnknown*, const void*, const IID*, void** out) {
if (out) *out = nullptr;
return E_FAIL;
}