summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-09-03 20:30:12 +0300
committerGitHub <noreply@github.com>2025-09-03 20:30:12 +0300
commit90aa693f2a9ece9f1c624dba245f202e126bca5b (patch)
treefae8bca7bb3f3ac05972803e2fefc05de8542408 /indra/newview/app_settings/shaders
parent5593cde0e85d4d4b06efacffb6f00ed2fadb188a (diff)
parent5ffcd3dc88892a651fe9a95974280efb85e18a8b (diff)
Merge Changes for support of apple silicon on macOS
Mac Arm
Diffstat (limited to 'indra/newview/app_settings/shaders')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/SMAA.glsl16
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/SMAA.glsl b/indra/newview/app_settings/shaders/class1/deferred/SMAA.glsl
index fdb77cce6e..5837308965 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/SMAA.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/SMAA.glsl
@@ -1351,6 +1351,10 @@ float4 SMAABlendingWeightCalculationPS(float2 texcoord,
//-----------------------------------------------------------------------------
// Neighborhood Blending Pixel Shader (Third Pass)
+vec3 srgb_to_linear(vec3 cs);
+vec4 srgb_to_linear4(vec4 cs);
+vec3 linear_to_srgb(vec3 cl);
+
float4 SMAANeighborhoodBlendingPS(float2 texcoord,
float4 offset,
SMAATexture2D(colorTex),
@@ -1369,6 +1373,7 @@ float4 SMAANeighborhoodBlendingPS(float2 texcoord,
SMAA_BRANCH
if (dot(a, float4(1.0, 1.0, 1.0, 1.0)) < 1e-5) {
float4 color = SMAASampleLevelZero(colorTex, texcoord);
+ color.rgb = srgb_to_linear(color.rgb);
#if SMAA_REPROJECTION
float2 velocity = SMAA_DECODE_VELOCITY(SMAASampleLevelZero(velocityTex, texcoord));
@@ -1377,6 +1382,7 @@ float4 SMAANeighborhoodBlendingPS(float2 texcoord,
color.a = sqrt(5.0 * length(velocity));
#endif
+ color.rgb = linear_to_srgb(color.rgb);
return color;
} else {
bool h = max(a.x, a.z) > max(a.y, a.w); // max(horizontal) > max(vertical)
@@ -1393,8 +1399,13 @@ float4 SMAANeighborhoodBlendingPS(float2 texcoord,
// We exploit bilinear filtering to mix current pixel with the chosen
// neighbor:
- float4 color = blendingWeight.x * SMAASampleLevelZero(colorTex, blendingCoord.xy);
- color += blendingWeight.y * SMAASampleLevelZero(colorTex, blendingCoord.zw);
+ float4 color = SMAASampleLevelZero(colorTex, blendingCoord.xy);
+ color.rgb = srgb_to_linear(color.rgb);
+ color = blendingWeight.x * color;
+
+ float4 color2 = SMAASampleLevelZero(colorTex, blendingCoord.zw);
+ color2.rgb = srgb_to_linear(color2.rgb);
+ color += blendingWeight.y * color2;
#if SMAA_REPROJECTION
// Antialias velocity for proper reprojection in a later stage:
@@ -1405,6 +1416,7 @@ float4 SMAANeighborhoodBlendingPS(float2 texcoord,
color.a = sqrt(5.0 * length(velocity));
#endif
+ color.rgb = linear_to_srgb(color.rgb);
return color;
}
}