Skip to content

fix(core): Fixes for initialization tracking of render targets - #10060

Open
andyleiserson wants to merge 5 commits into
gfx-rs:trunkfrom
andyleiserson:depth-init
Open

fix(core): Fixes for initialization tracking of render targets#10060
andyleiserson wants to merge 5 commits into
gfx-rs:trunkfrom
andyleiserson:depth-init

Conversation

@andyleiserson

@andyleiserson andyleiserson commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Fixes initialization tracking when depth slices of 3D textures are used as render targets, and also for div/reconvergent depth/stencil. Comprised of 5 commits:

  • Extends the ReadbackBuffers helper to cover MIP levels, depth slices, and array layers.
  • Add directed tests for various relevant cases
  • Fix for when depth/stencil load ops differ (mixed clear + load) and store ops are both discard, we recorded the discard in a temporary variable and then lost track of it.
  • Fixes TextureInitRange to be constructed from a TextureView rather than a TextureSelector. Knowing the dimension of the texture is necessary to set the layer range properly.
  • Fixes the initialization tracking when depth slices of 3D textures are used as render targets. Because we don't track initialization status of individual depth slices:
    • When a depth slice needs to be initialized, we must initialize the entire volume.
    • When a depth slice appears with StoreOp::Discard, we must reinitialize that depth slice before the end of the command buffer (including before use in later commands, if applicable, and being careful to leave live data in other slices untouched).
    • This is a simplified summary, there are more details in comments in the code.

Fixes #9455.

Testing
Enables CTS tests and adds directed tests.

Squash or Rebase? Rebase (after squashing any fixups)

Checklist

  • I self-reviewed and fully understand this PR.
  • WebGPU implementations built with wgpu may be affected behaviorally.
  • Validation and feature gates are in place to confine behavioral changes.
  • Tests demonstrate the validation and altered logic works.
  • CHANGELOG.md entries for the user-facing effects of this change are present.
    • Should have one, although maybe can be consolidated with some existing entry for the next release.
  • The PR is minimal, and doesn't make sense to land as multiple PRs.
  • Commits are logically scoped and individually reviewable.
  • The PR description has enough context to understand the motivation and solution implemented.

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.

Failures in webgpu:api,operation,rendering,3d_texture_slices:*

1 participant