-
Fix sRGB color clear · 64da65bdAlexis Hetu authored
According to the Vulkan spec: 2.9.2. Conversion from Floating-Point to Normalized Fixed-Point "The conversion from a floating-point value f to the corresponding unsigned normalized fixed-point value c is defined by first clamping f to the range [0,1], then computing ..." Also, in section 18.3. Clear Values: "float32 are the color clear values when the format of the image or attachment is one of the formats in the Interpretation of Numeric Format table other than signed integer (SINT) or unsigned integer (UINT). Floating point values are automatically converted to the format of the image, with the clear value being treated as linear if the image is sRGB" Added a clamp to sRGB values to avoid getting out of bound values for the sRGB color space. Bug: b/151469361 Change-Id: I22615b807384904ca4fa887e93529d5a4b185d04 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/45090 Presubmit-Ready: Alexis Hétu <sugoi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Alexis Hétu <sugoi@google.com>
64da65bd
×