Add layout(srgb_unpremul) to SkSL
For 3 and 4 channel float uniforms, this states that the data supplied
is unpremul sRGB, and transforms that data to the destination color
space (still unpremul) automatically.
Change-Id: I1b420d2fd10640963fa8e6736af3747cfc6e7d5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286656
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/gm/runtimeshader.cpp b/gm/runtimeshader.cpp
index 6ba36e6..ef5ee71 100644
--- a/gm/runtimeshader.cpp
+++ b/gm/runtimeshader.cpp
@@ -184,8 +184,8 @@
const char code[] = R"(
uniform float rad_scale;
uniform float2 in_center;
- uniform float4 in_colors0;
- uniform float4 in_colors1;
+ layout(srgb_unpremul) uniform float4 in_colors0;
+ layout(srgb_unpremul) uniform float4 in_colors1;
void main(float2 p, inout half4 color) {
float2 pp = p - in_center;