gpui_windows: Fix reversed linear/sRGB transfer functions in shader (#57543)
## Summary - swap the Windows HLSL exponents for `linear_to_srgb` and `srgb_to_linear` - align the Windows Oklab gradient path with the existing Metal and WGSL implementations ## Testing - not run (shader-only change) Fixes #57542 Release Notes: - [GPUI] Fix reversed linear/sRGB transfer functions Co-authored-by: Chris Biscardi <chris@christopherbiscardi.com>
This commit is contained in:
1 parent
1cea5261a1
commit
836c68bb20
1 file changed
+2
-2
@@ -127,12 +127,12 @@ float4 distance_from_clip_rect_transformed(float2 unit_vertex, Bounds bounds, Bo
|
||||
|
||||
// Convert linear RGB to sRGB
|
||||
float3 linear_to_srgb(float3 color) {
|
||||
return pow(color, float3(2.2, 2.2, 2.2));
|
||||
return pow(color, float3(1.0 / 2.2, 1.0 / 2.2, 1.0 / 2.2));
|
||||
}
|
||||
|
||||
// Convert sRGB to linear RGB
|
||||
float3 srgb_to_linear(float3 color) {
|
||||
return pow(color, float3(1.0 / 2.2, 1.0 / 2.2, 1.0 / 2.2));
|
||||
return pow(color, float3(2.2, 2.2, 2.2));
|
||||
}
|
||||
|
||||
/// Hsla to linear RGBA conversion.
|
||||
|
||||
Reference in new issue
Block a user