Float16Array

Sebastian Markbåge sebastian at calyptus.eu
Wed Jul 29 22:48:05 UTC 2015


IIRC, OpenGL ES 3.0 (and therefore WebGL 2.0) requires full float texture
support and full float32 operations in GLSL and hardware. Is there
significant gains to use half floats on modern hardware or do they
effectively end up on that same path as float32s?

My question becomes, is this a problem that will go away anyway or will it
be long lived?

If there are performance gains to be had even for the most modern hardware,
then I think we should be able to push this through.


On Fri, Nov 21, 2014 at 12:52 AM, Florian Bösch <pyalot at gmail.com> wrote:

> Typed arrays today are specified with support for Float32Array,
> Float32Array.
>
> A useful additional data type would be Float16Array. It's useful because
> GPUs (particularly mobiles) have support for it, and because VRAM and
> bandwidth limits are a legitimate concern (particularly for mobiles).
>
> GPU support for it appears in the following forms:
>
>    - Desktop OpenGL ARB_half_float_pixel: support for half-float textures
>    - Desktop OpenGL ARB_half_float_vertex: support for half-float vertex
>    data
>    - Desktop OpenGL 2.1 core specification, extended support in 3.0
>    - Mobile OES_texture_float: support for half-float textures
>    - Mobile OES_vertex_half_float: support for half-float vertex data
>    - Mobile EXT_color_buffer_half_float: support to render to half-float
>    render targets
>    - Mobile OpenGL ES 3.0 core specification.
>    - WebGL OES_texture_half_float: support for half-float textures
>    - WebGL OES_texture_half_float_linear: support for half-float texture
>    linear filtering
>    - WebGL EXT_color_buffer_half_float: support for half-float render
>    targets
>    - WebGL 2.0 core specification
>
> These types are defined per IEEE 753-2008
>
>    - binary16, common: half
>    - binary32, common: single
>    - binary64, common: double
>
> It is possible today to service half-float data types trough JS, by
> performing the conversion in JS. The code for this is however rather
> complex and it's difficult to implement all of IEEE 753-2008 correctly (my
> version doesn't support rounding quite correctly
> http://codeflow.org/experiment/half-float/main.js). It may also be
> unnecessarily slow. Convenience is also an issuebecause JS can't override
> the array access [] operator to do the job.
>
> I'd like to propose adding Float16Array to the typed array specification.
> If JS accesses arrays like these, appropriate conversion is applied (as is
> the case for any other non JS-native numerical type)
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150729/88e7dbf9/attachment-0001.html>


More information about the es-discuss mailing list