Skip to content

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

Backlog

Description

@tedin7

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

Activity

  1. tedin7 commented on Nov 26, 2026

    @tedin7
    CollaboratorAuthor

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

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions