Skip to content

Test that normalizing a zero-length vector produces 0 rather than NaN / Inf #3697

@kenrussell

Description

@kenrussell

@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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions