Fix float-to-half conversion
The Reactor code in floatToHalfBits() did not match the reference
implementation of the sw::half type, leading to failures in dEQP tests
which are enabled by the shaderStorageImageExtendedFormats feature.
The previous code was based on https://gist.github.com/rygorous/2156668.
It doesn't round to nearest even in case of a tie, but that's not
demanded by Vulkan. It merits a closer look to see whether there was a
bug, or whether dEQP-VK is too strict. Dawn also found the previous
implementation to not handle infinity correctly, so a bug seems likely.
In any case, it's good to use a reference implementation for now, and
look for optimization opportunities later.
Bug: b/147900455
Bug: swiftshader:147
Tests: dEQP-VK.image.format_reinterpret.buffer.*_b10g11r11_ufloat_pack32
Change-Id: Id817a012ff38af814907c2de2914ec24565622f3
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/46148
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by:
Nicolas Capens <nicolascapens@google.com>
Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
Showing
Please
register
or
sign in
to comment