Florian Bösch pyalot at gmail.com
Fri Nov 21 00:52:56 PST 2014

Typed arrays today are specified with support for 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
   - 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
   - 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)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141121/3b07c5cb/attachment-0001.html>

More information about the es-discuss mailing list