Skip to content

fix(vulkan): guard QueueSubmit's optional args, fix GetQueue transfer fallback - #754

Merged
JeanPhilippeKernel merged 2 commits into
developfrom
fix/queuesubmit-getqueue-null-and-transfer-fallback
Sep 5, 2026
Merged

fix(vulkan): guard QueueSubmit's optional args, fix GetQueue transfer fallback#754
JeanPhilippeKernel merged 2 commits into
developfrom
fix/queuesubmit-getqueue-null-and-transfer-fallback

Conversation

@JeanPhilippeKernel

Copy link
Copy Markdown
Owner

Summary

Two small, unrelated null-deref/abort bugs in VulkanDevice:

  • VulkanDevice::QueueSubmit dereferences signal_semaphore/fence before null-checking their nullptr defaults #741QueueSubmit(wait_stage_flag, command_buffer, signal_semaphore, fence) declares signal_semaphore/fence with nullptr defaults but dereferenced both unconditionally. Any caller relying on the documented default (submit without a signal semaphore/fence) crashed. Guarded every dereference; when no fence is given, the function now skips the wait/reset step and returns true immediately after submit instead of trying to wait on nothing.
  • VulkanDevice::GetQueue(TRANSFER_QUEUE) aborts when there's no separate transfer queue family #743GetQueue(TRANSFER_QUEUE) computed the queue family index with the correct HasSeperateTransfertQueueFamily fallback, but looked up the queue handle using the unadjusted typem_queue_map never has a TRANSFER_QUEUE entry on a device with no separate transfer queue family, so this was a hard abort (UnorderedHashMap::at) rather than a graceful fallback. Mirrors QueueWait's existing type-reassignment guard, which already had this right.

Neither path has any call site today (confirmed via repo-wide grep before fixing) — these are latent bugs in public API surface, not currently triggered — but both are cheap, well-scoped fixes worth closing before something starts relying on the documented defaults.

Test plan

…e redesign

The doc still described RRM's ImageHandle/GPUImage/ScheduleSwap(ImageHandle,...)
system as if it existed. PR #751 deleted that system outright (zero real
consumers) in favor of Rendering::Textures::TextureHandle everywhere. Update
the status header, naming note, and the two most misleading checklist items
to point at the real current API (IngestTexture, ScheduleTextureReload,
ReleaseTexture, GetTexture, VulkanDevice::DestroyTexture) instead of the
removed one. Sections 2-10's prose is left as-is and explicitly scoped as
accurate for buffers/meshes only, consistent with this doc's existing
correction-callout convention.
… fallback

VulkanDevice::QueueSubmit(wait_stage_flag, command_buffer, signal_semaphore,
fence) declares signal_semaphore/fence with nullptr defaults but dereferenced
both unconditionally — any caller relying on the documented default crashed.
Guard every dereference; skip the fence wait when no fence was given instead
of trying to wait on nothing.

VulkanDevice::GetQueue(TRANSFER_QUEUE) computed the family index with the
correct HasSeperateTransfertQueueFamily fallback, but looked up the queue
*handle* using the unadjusted type, which m_queue_map never has an entry for
on devices without a separate transfer queue family — a hard abort via
UnorderedHashMap::at. Mirror QueueWait's existing type-reassignment guard.

Closes #741, #743.
@JeanPhilippeKernel JeanPhilippeKernel added this to the Stable Core (1.0.0) milestone Sep 5, 2026
@JeanPhilippeKernel JeanPhilippeKernel added enhancement New feature or request area-linux Work on Linux system area-window Work on Window system area-macOS Work on macOS system labels Sep 5, 2026
@JeanPhilippeKernel JeanPhilippeKernel self-assigned this Sep 5, 2026
@JeanPhilippeKernel JeanPhilippeKernel moved this to In Progress in ZEngine Board Sep 5, 2026
@JeanPhilippeKernel
JeanPhilippeKernel merged commit a75e4f5 into develop Sep 5, 2026
17 checks passed
@JeanPhilippeKernel
JeanPhilippeKernel deleted the fix/queuesubmit-getqueue-null-and-transfer-fallback branch September 5, 2026 15:26
@github-project-automation github-project-automation Bot moved this from In Progress to Done in ZEngine Board Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-linux Work on Linux system area-macOS Work on macOS system area-window Work on Window system enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant