Skip to content

GPU: same-texture read/write bindings at different mip levels and read-only depth+sampler usage? #13871

@shakesoda

Description

@shakesoda

I've just updated my game from SDL 3.2.0 to 3.2.22 and ran into a bunch of new GPU validation errors (from #12925?). Most of them seemed legit (and would've saved me some prior debugging sessions even) but I'm not sure about a couple edge cases here:

  1. '!"Texture cannot be simultaneously bound as a color target and a sampler!"' from generating mips (I can't just use SDL_GenerateMipmapsForGPUTexture here, my bloom effect blurs down the chain and back up again) by rendering from level N to N+1 with the sampler min/max lods constrained to N.
  2. '!"Texture cannot be simultaneously bound as a depth stencil target and a sampler!"' from having texture bound for both sampling and depth testing at the same time but not using any depth/stencil writing.

Is the validation being too conservative here, particularly with 1? My understanding is that it's OK to do these things as long as you aren't actually doing any writing to the same level of a texture being read. I've worked around 2 with a depth copy, it just seems like it shouldn't have errored without any depth/stencil writing enabled on the pass (including the load/store ops).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions