Skip to content

DX12 per-slot fence counters signalled into a single shared fence #165

Description

@CanReader

src/Graphics/DirectX12/DirectX12Renderer.cpp:776-777, wait loop at :631-642;
writes at :1265 and src/Graphics/DirectX12/DirectX12Buffer.cpp:382

fenceValues[frameIndex]++;
Signal(fence, fenceValues[frameIndex]);

With FrameCount == 2 and both slots starting at 0, the two per-slot counters advance independently but are
signalled into one shared fence. Odd frames therefore re-signal a value the fence has already reached.

The "wait for ALL pending GPU work" loop at :631-642: whose own comment says it exists specifically to
prevent constant-buffer races: consequently short-circuits on every second frame, while the CPU overwrites
mapped UPLOAD-heap memory at :1265 and DirectX12Buffer.cpp:382.

Severity: corruption (races on every other frame).

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

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 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