mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:20:53 +01:00
[PR #1912] runtime: BAR-aware memory fallback, proc completeness, and zero-extent guards in PresentComposer (RT-PRESENT-COMPOSE-MEM-AND-GUARDS) #1923
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#1923
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/1912
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/rt-present-compose-mem-and-guards📝 Commits (1)
90022aeruntime: BAR-aware memory fallback, proc completeness, and zero-extent guards in PresentComposer (RT-PRESENT-COMPOSE-MEM-AND-GUARDS)📊 Changes
3 files changed (+389 additions, -30 deletions)
View changed files
📝
runtime/CMakeLists.txt(+7 -0)📝
runtime/src/vulkan_present_compose.h(+87 -30)➕
runtime/test/vk_present_compose_test.cpp(+295 -0)📄 Description
Item ID:
RT-PRESENT-COMPOSE-MEM-AND-GUARDS(claimed in #1608).Summary
Hardens
leonida::PresentComposer(runtime/src/vulkan_present_compose.h), which owns the PresentX compute composition pass and its RGBA16F output image (up to 64 MiB at 4K):ensure_target):DEVICE_LOCALloop withmemory_type_order()(preservingmemoryHeapCount == 0mock compatibility) plus!resizable_bar()pure-VRAM preference so the compose target stays off the 256 MiB BAR window on non-ReBAR GPUs, filters out undersized heaps (VUID-vkAllocateMemory-pAllocateInfo-01713), and retries all eligible memory types onVK_ERROR_OUT_OF_DEVICE_MEMORY.ready,~PresentComposer):PresentComposercalls (includingvkGetImageMemoryRequirements,vkBindImageMemory,vkCmdPipelineBarrier, and all destroy/free procs) so partial or mock devices cannot hit a null function pointer dereference.ready()fails partway through and guardsrelease_target()/release_pipeline()against null destroy procs.ensure_target):0x0extents (e.g. minimized windows) before callingrelease_target()orvkCreateImage(VUID-VkImageCreateInfo-extent-00944/00945), and clears output handles on failedvkCreateImage/vkCreateImageView/vkAllocateMemory.Verification
vk_present_compose(runtime/test/vk_present_compose_test.cpp, Clang 20, C++20,-Wall -Wextra -Werror):-O2× 3: PASSvulkan_present.h): PASS.main'svulkan_present_compose.h: fails onmain(ready()returnedtruewith missingvkGetImageMemoryRequirements), passes on this branch.python3 -I scripts/check_no_game_data.pyon all 3 touched files andpython3 -I tests/test_text_write_line_endings.pypassed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.