Skip to content

Conversation

@DerSchmale
Copy link
Contributor

Description
When declaring a texture_depth_2d in a shader, naga always outputs the texture uniform as type sampler2DShadow. When only interested in depth values and not comparisons, this breaks. This PR only uses sampler2DShadow when a comparison sampler is used for it. This is the only fix that I could come up with that only impacts the gles part.

This is a redo of closed PR #8301 , with fixed tests.

@teoxoy teoxoy self-assigned this Dec 10, 2025
@teoxoy
Copy link
Member

teoxoy commented Dec 15, 2025

This seems to be a heuristic rather than something that would make depth textures work with both comparison and non-comparison samplers.

We talked about this as part of the compat mode gpuweb/gpuweb#4970 and decided to disallow using depth textures with non-comparison samplers.

Note that you can always bind a depth texture as a texture_2d.

@teoxoy
Copy link
Member

teoxoy commented Dec 15, 2025

Tracking issue for compatibility mode: #8124.
See also: #4524.

@teoxoy teoxoy closed this Dec 15, 2025
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.

2 participants