KhronosGroup / KhronosGroup/WebGL
Test sampling from incomplete integer textures
- Dominant language
- HTML
- Stars
- 2.9k
- Forks
- 703
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 4
Description
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.
Contributor guide
Research direction
No file, test path, or entry point is named in the issue. Start by locating the existing tests for incomplete texture sampling, then compare behavior for integer textures with the WebGL 2.0 requirement; done means a regression test consistently verifies the specified result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- computer-graphics, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100