Float16Array

Alexander Jones alex at weej.com
Wed Jul 29 23:05:22 UTC 2015


In case it's not obvious, faster DMA and larger buffer/texture capacity vs.
float32. Many applications benefit hugely from having floating point data
but certainly do not need float32's range and precision - for those,
half/float16 is a great choice.

On 29 July 2015 at 23:48, Sebastian Markbåge <sebastian at calyptus.eu> wrote:

> 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
>>
>>
>
> _______________________________________________
> 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/20150730/6e9472c1/attachment.html>


More information about the es-discuss mailing list