Clamp unsigned floating-point formats.
GL_R11F_G11F_B10F is a renderable format (in the EXT_color_buffer_float
extension) with unsigned floating-point values, which we implement using
(signed) half- or single-precision floating-point types. So we need to
clamp values to a positive range before writing to them.
Change-Id: Ic21a5b0b33905c0aeab35299fc268158f8c679f9
Reviewed-on: https://swiftshader-review.googlesource.com/15448
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Shader/PixelPipeline.cpp b/src/Shader/PixelPipeline.cpp
index 5d4df97..e623735 100644
--- a/src/Shader/PixelPipeline.cpp
+++ b/src/Shader/PixelPipeline.cpp
@@ -356,6 +356,7 @@
case FORMAT_G32R32F:
case FORMAT_X32B32G32R32F:
case FORMAT_A32B32G32R32F:
+ // case FORMAT_X32B32G32R32F_UNSIGNED: // Not renderable in any fixed-function API.
convertSigned12(oC, current);
PixelRoutine::fogBlend(oC, fog);