KhronosGroup/WebGL

Test sampling from incomplete integer textures

Opened this issue · 0 comments

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.