Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test sampling from incomplete integer textures #3622

Open
lexaknyazev opened this issue Feb 8, 2024 · 0 comments
Open

Test sampling from incomplete integer textures #3622

lexaknyazev opened this issue Feb 8, 2024 · 0 comments

Comments

@lexaknyazev
Copy link
Member

OpenGL ES 3.0 spec says:

If a sampler is used in a vertex shader and the sampler’s associated texture is not complete, as defined in section 3.8.13, (0, 0, 0, 1) will be returned for a non-shadow sampler and 0 for a shadow sampler.

If a sampler is used in a fragment shader and the sampler’s associated texture is not complete, as defined in section 3.8.13, (0, 0, 0, 1) will be returned for a non-shadow sampler and 0 for a shadow sampler.

OpenGL ES 3.2 spec goes into more details:

If a sampler is used in a shader and the sampler’s associated texture is not complete, as defined in section 8.17, (0.0, 0.0, 0.0, 1.0), in floating-point, will be returned for a non-shadow sampler and 0 for a shadow sampler. In this case, if the sampler is declared in the shader as a signed or unsigned integer sampler type, undefined values are returned as specified in section 9.9 (“Texture Functions”) of the OpenGL ES Shading Language Specification when the texture format and sampler type are unsupported combinations.

The WebGL 2.0 spec has the following clause:

Texel fetches that have undefined results in the OpenGL ES 3.0 API must return zero, or a texture source color of (0, 0, 0, 1) in the case of a texel fetch from an incomplete texture in the WebGL 2.0 API.


The following values could be observed when sampling from an incomplete integer texture on different WebGL implementations:

  • (0, 0, 0, 1)
  • (0, 0, 0, 1065353216)
  • (0, 0, 0, 255)

A new test should be added to ensure consistent behavior.

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

No branches or pull requests

1 participant