Added support for half float in the Blitter
Implemented Float <-> Half conversion. The conversion is copied from
Half.cpp and is the same as the C++ code, converted to Reactor code.
The conversion is NOT optimized. Optimizing this code path will be
done later, this cl only cares about correctness.
Passes all conversion tests to and from half float in the following
patterns:
[dEQP-VK.api.copy_and_blit.core.blit_image]
.all_formats.color.[supported format].r16_sfloat.*
.all_formats.color.[supported format].r16g16_sfloat.*
.all_formats.color.[supported format].r16g16b16a16_sfloat.*
.all_formats.color.r16_sfloat.*
.all_formats.color.r16g16_sfloat.*
.all_formats.color.r16g16b16a16_sfloat.*
Bug b/119620767
Change-Id: Icd725dcd2ddd8c54e6657a2c3210da270210a149
Reviewed-on: https://swiftshader-review.googlesource.com/c/23329
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
diff --git a/src/Reactor/Reactor.hpp b/src/Reactor/Reactor.hpp
index ba67afa..fe4cf1d 100644
--- a/src/Reactor/Reactor.hpp
+++ b/src/Reactor/Reactor.hpp
@@ -49,6 +49,7 @@
class Int4;
class UInt4;
class Long;
+ class Half;
class Float;
class Float2;
class Float4;
@@ -1923,11 +1924,20 @@
RValue<UInt4> Min(RValue<UInt4> x, RValue<UInt4> y);
// RValue<UInt4> RoundInt(RValue<Float4> cast);
+ class Half : public LValue<Half>
+ {
+ public:
+ explicit Half(RValue<Float> cast);
+
+ static Type *getType();
+ };
+
class Float : public LValue<Float>
{
public:
explicit Float(RValue<Int> cast);
explicit Float(RValue<UInt> cast);
+ explicit Float(RValue<Half> cast);
Float() = default;
Float(float x);