Sitelet https://github.com/gpuweb/gpuweb/issues/4970
Skip to content

Compat: Disallow usage of depth textures with non-compare sampling functions. #4970

Description

@teoxoy

All sampling operations on shadow samplers require depth ref in GLSL 3.1, i.e. they are all compare operations as defined by our spec.

For shadow forms (the sampler parameter is a shadow-type), a depth comparison lookup on the depth
texture bound to sampler is done as described in section 8.19 “Texture Comparison Modes” of the
OpenGL ES Graphics System Specification. See the table below for which component specifies Dref. The
texture bound to sampler must be a depth texture, or results are undefined. If a non-shadow texture call is
made to a sampler that represents a depth texture with depth comparisons turned on, then results are
undefined. If a shadow texture call is made to a sampler that represents a depth texture with depth
comparisons turned off, then results are undefined. If a shadow texture call is made to a sampler that does
not represent a depth texture, then results are undefined.

from Section 8.9 Texture Functions of https://registry.khronos.org/OpenGL/specs/es/3.1/GLSL_ES_Specification_3.10.withchanges.pdf

Sparked from gfx-rs/wgpu#6529 (comment).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiWebGPU APIcompatWebGPU Compatibility Mode

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions