Fix undefined behavior in FloatToHalf
authorMika Väinölä <mika.vainola@siru.fi>
Tue, 19 Jan 2021 14:00:32 +0000 (16:00 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 18 Feb 2021 11:08:39 +0000 (11:08 +0000)
commitfcd576cb32b99b12d195af9e76c105a2682e31d6
treeae94fb6acfb121fcfd036c5c3ce432ac127999aa
parent84d88c1dcc0c25adc1d54104673cc2d12e4962bb
Fix undefined behavior in FloatToHalf

The size of the exponent and mantissa in a GLhalf is smaller than
a GLfloat. This means that small numbers (that approach 0.0) will
become 0.0. This can result in doing a right-shift by 32 or more bits,
which is undefined behavior. It works with some older compilers/CPUs,
but not with newer clang.

Affects: KHR-GLES31.core.vertex_attrib_binding.basic-input-case*

Components: OpenGL ES

VK-GL-CTS issue: 2723

Change-Id: I0b1d309c6919576ef63d19f72bca37254ca11b8f
external/openglcts/modules/gles31/es31cVertexAttribBindingTests.cpp