mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:35:53 +01:00
[PR #927] [MERGED] vk: probe whole title-region host imports (RT-TITLE-HOST-REGION) #967
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#967
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/927
Author: @roanh47
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:pr/host-region-probe📝 Commits (2)
e82ca07vk: probe whole title-region host importsed1de62vk: make the host-region probe skip where it cannot import📊 Changes
2 files changed (+371 additions, -0 deletions)
View changed files
📝
runtime/CMakeLists.txt(+16 -0)➕
runtime/test/vk_host_region_import_test.cpp(+355 -0)📄 Description
Claimed in coordination issue #14 as
RT-TITLE-HOST-REGION(probe portion).What and why
The retail frame is black because the title writes vertices, descriptors and constants into memory that the Vulkan GPU-address arena does not read. The planned fix imports one committed title host region as the arena and rebases title addresses by subtraction.
This PR adds the capability gate for that path: one contiguous committed host allocation is imported as a buffer-device-addressable Vulkan buffer with
VK_EXT_external_memory_host, then checked in both directions:The default CTest case imports 185 MiB, the measured title placeholder size. A successful import must pass both coherence checks; a machine that cannot import reports a skip, not a pass and not a failure.
Exit codes
077(SKIP_RETURN_CODE)VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE), has no commit room for the region, or there is no Vulkan 1.3 device withVK_EXT_external_memory_hostand buffer device addresses. Each skip prints oneSKIP vk_host_region_import: ...line that says which.1VK_ERROR_DEVICE_LOST, any other failingVkResult, a broken driver answer, or a validation error.Capability is checked before anything is allocated, with the Vulkan 1.1
vkGetPhysicalDeviceExternalBufferPropertiesquery for the exact usage set andVK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT.VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BITis honoured withVkMemoryDedicatedAllocateInfo, so a device that requires a dedicated allocation is probed instead of skipped.The copy whose destination the CPU compares ends with a
TRANSFER→HOSTmemory barrier, as the fill path already did.Tested
Windows 11, MSVC 19.44.35230 (14.44), NVIDIA GeForce RTX 3070, driver 610.88, Vulkan SDK 1.4.363.0.
The validation variant runs the same binary with
LEONIDA_VK_VALIDATION=1andVK_VALIDATE_SYNC=1; it exits 77 (not 1) whereVK_LAYER_KHRONOS_validationis not installed, so a machine without the SDK skips it instead of failing it.Manual run of the 185 MiB default case, exit
0, zero validation errors:The same with
LEONIDA_VK_VALIDATION=1 VK_VALIDATE_SYNC=1printsdevice: NVIDIA GeForce RTX 3070 (validation on), the same import line, and exits0with no validation errors.vk_sync_validationreports its expected hazard on this machine, so the layer and synchronization validation were active.Other sizes, same binary:
python -I scripts/check_no_game_data.py runtime/test/vk_host_region_import_test.cpp runtime/CMakeLists.txtis clean.Not covered
result=not-importablebranch is not exercised here: every device available to me reports the usage set importable. It is a three-field query (compatibleHandleTypes,externalMemoryFeatures) against the value the driver returns, and the skip it prints is identical in form to the one exercised by the allocation refusals above.VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BITpath is not exercised either: the RTX 3070 reportsimport-features=0x6(importable, protected), so no dedicated allocation was requested.No game data is included. The test needs only a Vulkan GPU with
VK_EXT_external_memory_hostand buffer device addresses.AI-assisted (DeepSeek v4.1 Flash 1017).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.