Skip to content

R-3: order pending texture readbacks before dependent submissions - #68

Open
JohnReedV wants to merge 2 commits into
ProjectLeonidaL:mainfrom
JohnReedV:codex/readback-queue-order
Open

JohnReedV wants to merge 2 commits into
ProjectLeonidaL:mainfrom
JohnReedV:codex/readback-queue-order

Conversation

@JohnReedV

Copy link
Copy Markdown
Contributor

A texture-to-buffer readback can still be in flight when a later submission prepares a CPU-side copy from that buffer. Ordinary readback destinations were omitted from pending-write tracking, and speculative fills could also bypass readback dependencies. The later copy could therefore use stale bytes.

Track definite readback destinations through submission and relay completion, including pitched rows without padding. Overlapping CPU preparation waits for copy-back to finish; unrelated work and speculation over shader-only write ranges retain their behavior.

Validation on an i9-14900KS, RTX 5090, NVIDIA 580.173.02, Pop!_OS, Proton 11.0 and vkd3d-proton 3.2.0:

  • A deterministic synthetic D3D12 test holds a one-texel producer behind a fence and submits its dependent copy separately. The baseline incorrectly copies 0; the fix copies the expected 37, in each relay mode 0/1/2. The gate is released by an observed dependency wait or completed stale copy, not a sleep.
  • Five Windows CPU tests pass; an additional harness using the production collector and dependency decision passes eight checks and reproduces the old failure.
  • Windows workspace Clippy passes for all targets in default and all-feature configurations; asset policy and diff checks pass. Cross-build uses BLAKE3 intrinsics.

Found while investigating R-3; that item remains open. This fixes ordering between separate submissions. Dependencies already grouped in one submission still need command-list splitting. No claim that this resolves the washed-out frames or improves FPS. The optional GPU test is documented and requires explicit software/hardware opt-in.

AI-assisted. No game assets or derived files are included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant