Skip to content

How to write NaN in a shader? #3749

@unconed

Description

@unconed

In the latest Chrome Canary, bitcasting a float to a NaN no longer works, i.e.:

  let NaN: f32 = bitcast<f32>(0xffffffffu);

Apparently this is intentional:
#3468

How am I supposed to return NaN from a shader now? This is a common way to knock out vertices from an otherwise continuous geometry stream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionwgslWebGPU Shading Language Issues

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions