startup: texture uploads report success when staging fails, and video-sized textures share one upload ring #2855

Open
opened 2026-11-27 01:26:59 +00:00 by github-bot · 1 comment
Owner

@⁠tedin7 on GitHub · 2026-11-26 14:29 UTC · original

Part of #870

Related: #2837, #2849 (upload ring recycling).

Problem 1: false success. upload_texture (src/startup_stubs/d3d12_draw.inl) returns true with state.done = false at five exits when the upload ring cannot stage a level. The caller treats true as "uploaded", so a draw samples, or a copy reads, a desktop texture that holds none or only some of its levels, and nothing retries it until the title memory changes.

Problem 2: large CPU textures use the shared ring. A linear title texture of 1 MiB or more (for example the planes of a 1920x1080 video frame, about 12 MiB per frame) is copied through the same transient upload ring as everything else. A burst of such uploads can exhaust or retire the ring while other uploads are in flight.

Expected.

  1. A level that cannot be staged makes upload_texture return false. A draw then binds no texture, a copy from the title texture is refused (title_backed_source, and source_not_uploaded for CopyTextureRegion), and the next bind retries every level.
  2. A linear texture of 1 MiB or more is filled from its own upload buffer, which lives until the copy has executed.

Tests. startup_slot133_heap_cap_check gains a video variant (40 textures of 1920x1080 RGBA8, both corners read back) and a stagefail variant (three-level texture, forced staging failure, then retry; lazy textures off and on). Fixture-only switch: X2W_TEST_UPLOAD_STAGING_FAIL=<n>.

Out of scope. Ring recycling itself (#2849).

**@⁠tedin7** on GitHub · 2026-11-26 14:29 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/2855) Part of #870 Related: #2837, #2849 (upload ring recycling). **Problem 1: false success.** `upload_texture` (src/startup_stubs/d3d12_draw.inl) returns `true` with `state.done = false` at five exits when the upload ring cannot stage a level. The caller treats `true` as "uploaded", so a draw samples, or a copy reads, a desktop texture that holds none or only some of its levels, and nothing retries it until the title memory changes. **Problem 2: large CPU textures use the shared ring.** A linear title texture of 1 MiB or more (for example the planes of a 1920x1080 video frame, about 12 MiB per frame) is copied through the same transient upload ring as everything else. A burst of such uploads can exhaust or retire the ring while other uploads are in flight. **Expected.** 1. A level that cannot be staged makes `upload_texture` return `false`. A draw then binds no texture, a copy from the title texture is refused (`title_backed_source`, and `source_not_uploaded` for CopyTextureRegion), and the next bind retries every level. 2. A linear texture of 1 MiB or more is filled from its own upload buffer, which lives until the copy has executed. **Tests.** `startup_slot133_heap_cap_check` gains a `video` variant (40 textures of 1920x1080 RGBA8, both corners read back) and a `stagefail` variant (three-level texture, forced staging failure, then retry; lazy textures off and on). Fixture-only switch: `X2W_TEST_UPLOAD_STAGING_FAIL=<n>`. **Out of scope.** Ring recycling itself (#2849).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:26:59 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 14:29 UTC · original

Claiming this; a Draft PR follows after a confirming run.

**@⁠tedin7** on GitHub · 2026-11-26 14:29 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/2855#issuecomment-7194901357) Claiming this; a Draft PR follows after a confirming run.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/R0Y00--Xbox2Windows#2855
No description provided.