RT-NULL-BARRIER-CLEAR: console null-resource barriers and null-view clears no longer drop the submission #1504

Closed
leonida/mandy
ubiquitarianism wants to merge 0 commits from fix/rt-null-barrier-clear into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

ubiquitarianism commented 2026-11-25 02:32:28 +00:00

Claimed in the coordination issue as: RT-NULL-BARRIER-CLEAR (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7150446086)

Depends on: #1495

The retail title makes two console command-list calls that each put the PC list into its error state. When that happens, Close fails and ExecuteCommandLists drops the whole submission. This PR handles both the way the console does.

List slot 146: Barrier, GCL7 slot 80

The console treats a texture barrier with no resource as a global barrier.

  • Null resource: the barrier is now forwarded as a D3D12_GLOBAL_BARRIER with the same sync and access words.
  • Mixed groups: a group with both kinds is split into texture, global and texture runs, in their original order. The converted barriers are built in storage that lives for the call.
  • Nothing to convert: the call is forwarded unchanged, with the title's own pointer.
  • Unreadable group array: the whole call is refused, nothing is recorded, and each reason is logged once. This covers a null pointer with a nonzero count, an unknown group type and an absurd count.

List slot 52: ClearRenderTargetView, PC slot 48

The title creates some render-target views with no resource and clears them every frame. On the console that clear does nothing.

  • Marking: the device proxy marks the real handle when CreateRenderTargetView gets a null resource.
  • Updating the marks: CopyDescriptors and CopyDescriptorsSimple of RTVs move the marks with the descriptors. A view later re-created with a resource clears the mark.
  • The clear: a clear of a marked view is skipped and logged once. Every other view keeps today's path.

The proxy keeps its own marks because the layer's descriptor state can't tell a null-resource view apart from a view it failed to create.

Known gap: RTV records that the title copies with its own memcpy are not followed.

Tests

  • Mock list: xs_proxy_mock_test now models the PC error state in its mock list, so its Close fails the way the real layer does.
  • New check_console_null_barrier_and_clear cases:
    • the null-resource barrier becomes a global barrier, and the list still closes;
    • a valid texture barrier passes through unchanged;
    • mixed groups split in order;
    • six malformed calls are each refused;
    • a null-view clear is skipped, while a real view is still cleared;
    • re-creating a view, both descriptor-copy forms, and isolation between devices.
  • Changed tests: two older slot-146 cases passed garbage words, which the new check refuses, so they now pass valid ones.

Windows 11, VS 2026, Windows SDK 10.0.26100: ctest has 310 of 312 passing. The two failures, d3d12_texture_tiles and d3d12_clear, also fail on plain main. These cases are confirmed by the mock tests only, not by a retail run. docs/d3d12_vulkan.md §4.9 records both behaviours.

Claimed in the coordination issue as: RT-NULL-BARRIER-CLEAR (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7150446086) Depends on: #1495 The retail title makes two console command-list calls that each put the PC list into its error state. When that happens, `Close` fails and `ExecuteCommandLists` drops the whole submission. This PR handles both the way the console does. ## List slot 146: `Barrier`, GCL7 slot 80 The console treats a texture barrier with no resource as a global barrier. - **Null resource:** the barrier is now forwarded as a `D3D12_GLOBAL_BARRIER` with the same sync and access words. - **Mixed groups:** a group with both kinds is split into texture, global and texture runs, in their original order. The converted barriers are built in storage that lives for the call. - **Nothing to convert:** the call is forwarded unchanged, with the title's own pointer. - **Unreadable group array:** the whole call is refused, nothing is recorded, and each reason is logged once. This covers a null pointer with a nonzero count, an unknown group type and an absurd count. ## List slot 52: `ClearRenderTargetView`, PC slot 48 The title creates some render-target views with no resource and clears them every frame. On the console that clear does nothing. - **Marking:** the device proxy marks the real handle when `CreateRenderTargetView` gets a null resource. - **Updating the marks:** `CopyDescriptors` and `CopyDescriptorsSimple` of RTVs move the marks with the descriptors. A view later re-created with a resource clears the mark. - **The clear:** a clear of a marked view is skipped and logged once. Every other view keeps today's path. The proxy keeps its own marks because the layer's descriptor state can't tell a null-resource view apart from a view it failed to create. Known gap: RTV records that the title copies with its own `memcpy` are not followed. ## Tests - **Mock list:** `xs_proxy_mock_test` now models the PC error state in its mock list, so its `Close` fails the way the real layer does. - **New `check_console_null_barrier_and_clear` cases:** - the null-resource barrier becomes a global barrier, and the list still closes; - a valid texture barrier passes through unchanged; - mixed groups split in order; - six malformed calls are each refused; - a null-view clear is skipped, while a real view is still cleared; - re-creating a view, both descriptor-copy forms, and isolation between devices. - **Changed tests:** two older slot-146 cases passed garbage words, which the new check refuses, so they now pass valid ones. Windows 11, VS 2026, Windows SDK 10.0.26100: ctest has 310 of 312 passing. The two failures, `d3d12_texture_tiles` and `d3d12_clear`, also fail on plain `main`. These cases are confirmed by the mock tests only, not by a retail run. `docs/d3d12_vulkan.md` §4.9 records both behaviours.
aslan2142 commented 2026-11-26 03:09:05 +00:00

Closing as included: #2138, merged as 0b11d86bc, carries this PR's commit 1dd7b32c1 (one line wrapped differently). It adds one fix on top: the null-RTV marks are dropped when their heap is released, so a reused address no longer keeps a stale mark (mock test added).

AI-assisted (Claude Code, Claude Opus 5.5).

Closing as included: #2138, merged as `0b11d86bc`, carries this PR's commit `1dd7b32c1` (one line wrapped differently). It adds one fix on top: the null-RTV marks are dropped when their heap is released, so a reused address no longer keeps a stale mark (mock test added). AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No description provided.