-
-
Notifications
You must be signed in to change notification settings - Fork 162
Open
Labels
Description
Currently, shaders can only read depth data from textures with the d24s8 and d32fs8 formats. It could sometimes be useful to read the stencil data as well.
We could support this via the following:
- Add an
aspectoption when creating a texture view. It would be ignored for color textures, but can bedepthorstencilfor depth/stencil textures, defaulting todepth. Alsotexture:getAspect? - Add a
stencil8format (this isn't actually necessary for this feature, but is just nice for completeness). - Ensure that
usamplerandisamplershader resources are supported. We can parse this metadata from SPIR-V, and we have to do it anyway for WebGPU, so may as well. - Something something linear sampling for integer formats (samplers with
linearfiltering can't be used with integer textures). There could be a texture feature for this, possibly some validation, but maybe unnecessary. - Double check we're not missing anything to support stencil storage textures.
Hopefully we can get away with all this without actually adding integer texture formats.
There's an entire rabbit hole of other depth vs. stencil stuff we could do, but just sampling stencil data in shaders is a good start.
Reactions are currently unavailable