mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:25:53 +01:00
[PR #1963] runtime: check vkEnumerateDeviceExtensionProperties results and harden device_proc_or_khr in vulkan13_features #1969
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#1969
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/1963
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/rt-vulkan13-features-enum-and-proc-safety📝 Commits (1)
db6916fruntime: check extension enumeration results and guard device_proc_or_khr in vulkan13_features📊 Changes
2 files changed (+164 additions, -10 deletions)
View changed files
📝
runtime/src/vulkan13_features.h(+38 -9)📝
runtime/test/vulkan13_features_test.cpp(+126 -1)📄 Description
Claim:
RT-VULKAN13-FEATURES-ENUM-AND-PROC-SAFETY(claim comment#7168584905on #1608).Fixes (
runtime/src/vulkan13_features.h)VkResulton bothvkEnumerateDeviceExtensionPropertiescalls (Vulkan 1.2 / MoltenVK path):VkResult: a failed count query could leavecountuninitialized/poisoned and allocate from it, acount == 0device issued an unnecessary second call, a failed fill query still inspectedextensions, aVK_INCOMPLETEfill dropped extensions instead of retrying, and a short fill (count < extensions.size()) scanned unwritten trailing entries.query()returns immediately on any error orcount == 0, retriesVK_INCOMPLETEup to 4 times, and resizesextensionsto the actual returnedcount.device_proc_or_khr()and eliminate per-lookup heap allocations:get, nullname, or emptyname(previously dereferenced null).KHR/EXT(with a single-allocationstd::stringfallback only for unusually long names > 252 bytes) instead of allocating two temporarystd::strings per Vulkan device proc lookup.compute_full_subgroupsgating on Vulkan 1.3:compute_full_subgroupsonsubgroup_size_controlon Vulkan 1.3 (in bothquery()andenable()), matching the existing Vulkan 1.2 path.Verification
CMakeLists.txtchanges).runtime/test/vulkan13_features_test.cppto cover count error (poisoned count),count == 0, fill error, transientVK_INCOMPLETEretry, persistentVK_INCOMPLETEbounded exit, short fill ignoring trailing slots, Vulkan 1.3compute_full_subgroupsgating, null/emptydevice_proc_or_khrinputs, and long-name heap fallback.vulkan13_features_testcleanly under:clang++ -std=c++20 -O1 -g -fsanitize=address,undefined -Wall -Wextra -Wno-missing-field-initializers -Werrorclang++ -std=c++20 -O1 -g -fsanitize=thread -Wall -Wextra -Wno-missing-field-initializers -Werrorclang++ -std=c++20 -O2 -Wall -Wextra -Wno-missing-field-initializers -Werrorpython3 -I scripts/check_no_game_data.pyon both files andpython3 -I tests/test_text_write_line_endings.py: all passed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.