mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:05:53 +01:00
[PR #71] fix(vulkan): use memory_type_order with OOM fallback in PredicateReducer::batch #123
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#123
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/71
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/9794📝 Commits (1)
028df8bfix(vulkan): use memory_type_order with OOM fallback in PredicateReducer::batch📊 Changes
3 files changed (+306 additions, -9 deletions)
View changed files
📝
runtime/CMakeLists.txt(+6 -0)📝
runtime/src/vulkan_predicate.h(+11 -9)➕
runtime/test/predicate_alloc_test.cpp(+289 -0)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Summary
Fixes
VUID-vkAllocateMemory-pAllocateInfo-01713and missing OOM memory-type fallback inleonida::PredicateReducer::batch()(runtime/src/vulkan_predicate.h:70-81), matching thememory_type_order()policy used ind3d12_vulkan_device.cppandvulkan_indirect_dispatch_count.h(#8978):leonida::memory_type_order()(runtime/src/vulkan_memory.h), skipping any memory type whose heap is smaller thanrequirements.size(and boundingmemoryTypeCount/heapIndex).vkAllocateMemory()fails (e.g.,VK_ERROR_OUT_OF_DEVICE_MEMORY), resettingb->memory = VK_NULL_HANDLEon each failed attempt so~Batch()cleans up cleanly.Testing
runtime/test/predicate_alloc_test.cpp(registered aspredicate_allocunderVulkan::Headers, no GPU required). Before the fix it failed atline 220: state.alloc_attempts[0].first == 1u(attempting to allocate 2048 B from a 1024 B heap).Debug&RelWithDebInfo, MSVC): 0 new warnings acrosspredicate_alloc_test,d3d12_state_map_test,vk_predicate_capture_test, andvk_command_replay_test.Debug&RelWithDebInfo) + RTX 4070 Ti withLEONIDA_VK_VALIDATION=1:predicate_alloc: Passed (Debug & RelWithDebInfo)d3d12_state_map: Passed (Debug & RelWithDebInfo)vk_predicate_capture: Passed on NVIDIA GeForce RTX 4070 Ti with Vulkan validation enabled (32 gated + 32 reused submissions, 192 snapshots, 0 validation errors)vk_command_replay: Passed on NVIDIA GeForce RTX 4070 Ti with Vulkan validation enabled (0 validation errors)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.