Skip to content

fix(core): Fix resource usage for R/O depth w/o TEXTURE_BINDING - #9346

Merged
teoxoy merged 3 commits into
gfx-rs:trunkfrom
andyleiserson:jj-push-wwwu
Mar 31, 2026
Merged

fix(core): Fix resource usage for R/O depth w/o TEXTURE_BINDING#9346
teoxoy merged 3 commits into
gfx-rs:trunkfrom
andyleiserson:jj-push-wwwu

Conversation

@andyleiserson

@andyleiserson andyleiserson commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Fixes #9343 a.k.a. Firefox bug 1987462.

When opening a render pass with a read-only depth attachment, wgpu automatically applies TextureUses::RESOURCE in addition to TextureUses::DEPTH_STENCIL_READ. These are compatible usages, and most of the time this did not cause a problem, but if the texture view does not have TextureUsages::TEXTURE_BINDING, dx12 will raise an error that the resource cannot be transitioned to the states associated with TextureUses::RESOURCE.

Testing
Adds a regression test as a GPU test. The test can also serve as a regression test for #5231 (which remains an issue, so the test is marked as expect-fail on Vulkan).

Squash or Rebase? Squash

Checklist

  • Should probably have a CHANGELOG.md entry.

@teoxoy teoxoy self-assigned this Mar 31, 2026

@teoxoy teoxoy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@teoxoy
teoxoy merged commit e14050d into gfx-rs:trunk Mar 31, 2026
59 checks passed
@andyleiserson
andyleiserson deleted the jj-push-wwwu branch March 31, 2026 18:43
slyedoc pushed a commit to slyedoc/wgpu that referenced this pull request May 28, 2026
…rs#9346)

* fix(core): Fix resource usage for R/O depth w/o TEXTURE_BINDING

Fixes gfx-rs#9343

* Update test and waive failure

Related to gfx-rs#5231

* changelog
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.

dx12 crash when using a read-only depth texture without TextureUsages::TEXTURE_BINDING

2 participants