Add rendering tests for all color formats

BUG=dawn:128

Change-Id: I32cab39e77847388a7736a51532a1b5c24a0fde7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8684
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez
2019-07-12 07:13:41 +00:00
committed by Commit Bot service account
parent e896a0da66
commit 2d8ba5fac6
4 changed files with 197 additions and 90 deletions

View File

@@ -109,6 +109,10 @@ uint16_t Float32ToFloat16(float fp32) {
}
}
bool IsFloat16NaN(uint16_t fp16) {
return (fp16 & 0x7FFF) > 0x7C00;
}
// Based on the Khronos Data Format Specification 1.2 Section 13.3 sRGB transfer functions
float SRGBToLinear(float srgb) {
// sRGB is always used in unsigned normalized formats so clamp to [0.0, 1.0]