Skip to content

gShadowRaw deferred binding is dead: CONFIRMED, with a correction to the known lead #148

Open

Description

@CanReader

assets/shaders/lighting_pass.frag:20 (set 0, binding 5); descriptor written at
src/Graphics/Vulkan/VulkanDeferred.cpp:789-799

gShadowRaw is declared at lighting_pass.frag:20 and never sampled: the file's only shadow fetch is
:99, texture(gShadow, ...). The descriptor is nonetheless written every frame at VulkanDeferred.cpp:789-799.

Correction to the lead (and to CLAUDE.md §7 item 2): the lead says "the gShadowRaw binding plus its
sampler and descriptor writes are dead". The sampler is NOT dead and must not be deleted.
m_shadowRawSampler (VulkanShadow.cpp:92-102) also feeds set 3, binding 1
(VulkanShadow.cpp:236-264, re-written on resize at VulkanRenderer.cpp:1643-1665), and that binding is
sampled by the forward shaders: default_shader.frag:42 and :66, skinned_shader.frag:37 and :76.

Only the deferred set-0/binding-5 half (the declaration at lighting_pass.frag:20 and the write at
VulkanDeferred.cpp:789-799) is removable. Deleting the sampler would break forward-path shadows.

Severity: minor (dead descriptor write per frame).

Found by a full audit of the graphics layer. Assessed severity: minor: dead code.

Activity

  1. added this to the 0.1 Stability milestone 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 workingpriority: lowNice to have

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions