Skip to content

Runtime sampler change frees a VkSampler still referenced by in-flight command buffers #153

Open

Description

@CanReader

src/Graphics/Vulkan/VulkanTexture.cpp:216-244 (:219, :229, :239), :246-267, :270-274

SetFilter, SetWrapMode and SetLodBias each call vkDestroySampler immediately (lines 219, 229, 239)
and then rewrite descriptor sets (UpdateDescriptorSets, :246-267): with no vkDeviceWaitIdle and no
fence gate
, while up to MAX_FRAMES_IN_FLIGHT command buffers referencing the old sampler are still
pending. Violates VUID-vkDestroySampler-sampler-01082.

Trigger: the Filter combo at SleakCraft/Game/src/UI/SettingsPanel.cpp:280 and LOD Bias at :287: i.e. a
user changing texture filtering in the settings panel.

Second-order and permanent: m_imguiDescriptorSet is created once (VulkanTexture.cpp:270-274) and never
refreshed by UpdateDescriptorSets. So after any filter change, every ImGui draw of that texture samples a
destroyed sampler for the rest of the session.

Severity: crash.

Found by a full audit of the graphics layer. Assessed severity: crash.

Activity

  1. added this to the 0.1 Stability milestone on Sep 4, 2026
  2. added
    bugSomething isn't working
    area: renderingRenderer, shaders, post processing
    backend: vulkanSpecific to the vulkan backend
    priority: criticalCrash, data loss, or blocks other work
    crashCauses a crash or hang
    on Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: renderingRenderer, shaders, post processingbackend: vulkanSpecific to the vulkan backendbugSomething isn't workingcrashCauses a crash or hangpriority: criticalCrash, data loss, or blocks other work

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions