Skip to content

DX12 shadow pass shares one 256-byte upload buffer across every shadow caster #166

Description

@CanReader

src/Graphics/DirectX12/DirectX12Renderer.cpp:1054-1078; callers at
src/Graphics/Common/RenderCommandQueue.cpp:196-211; execute at :768

The shadow path memcpys each caster's LightVP * World into the same mapped allocation and binds the
same GPU virtual address. RenderCommandQueue.cpp:196-211 calls it once per caster, but nothing actually
executes until ExecuteCommandLists at :768: so by then the buffer holds only the last caster's matrix and
every shadow draw rasterizes with it.

Root cause is a mechanical port: this is Vulkan's push-constant path (VulkanRenderer.cpp:711-721, whose
comment notes the value is "recorded into the command buffer per draw call") transplanted onto a deferred
mechanism where that guarantee does not hold.

Severity: corruption (shadow map contains only one caster).

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

Activity

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: dx12Specific to the dx12 backendbackend: vulkanSpecific to the vulkan backendbugSomething isn't workingpriority: criticalCrash, data loss, or blocks other workvisualIncorrect or degraded rendering output

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions