Skip to content

Would having Float16Array in JS be useful for integration with WebGPU? #3848

@bakkot

Description

@bakkot

I'm on TC39. We've had a request from the ColorWebCG to add a Float16Array to represent float-backed canvases.

In pursuing that proposal within TC39, it would be helpful to know if it would be useful for people integrating with WebGPU as well. I saw that float16 is supported in WebGPU, and I saw an example of wrapping a buffer in a Float32Array. Can I conclude that therefore some buffers are created holding float16 values, and that it would be helpful in some cases to wrap those buffers in a Float16Array? I am guessing so, but I haven't gone through the WebGPU spec before, and it's a bit too large for me to confidently conclude either way.

I've tentatively added that as a use case to the proposal for now, but am happy to remove it if I'm mistaken.

(To be clear, this would be specifically IEEE754 "binary16" floats, not bfloat16.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions