KhronosGroup / KhronosGroup/WebGL
Test that normalizing a zero-length vector produces 0 rather than NaN / Inf
- Dominant language
- HTML
- Stars
- 2.9k
- Forks
- 703
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 4
Description
@lexaknyazev found that applications using the (old, no longer maintained) SceneJS framework are rendering incorrectly on Apple Silicon because the GLSL `normalize()` operation is being called on 0-length vectors. This behavior isn't defined in GLSL, but it happens to return a zero-length vector on basically all other GPU hardware. On Apple Silicon it produces a vector containing NaNs.
To improve WebGL's portability, the WebGL WG agreed to add a test for this case and to work around it in ANGLE's shader translator on this hardware.
Contributor guide
Research direction
The issue names no files or existing tests. Locate the WebGL conformance-test entry point for GLSL normalize behavior, then add coverage showing that normalizing a zero-length vector produces zero rather than NaN or Inf, and run the relevant test suite.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100