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:
Minh VuandChris Biscardi authored and GitHub committed 2026-09-17 16:09:12 +00:00
1 parent 1cea5261a1
commit 836c68bb20
1 file changed
+2 -2
+2 -2
View File
@@ -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.