From cd8f88cd1548a2966eb1c4bfe0677427fa885140 Mon Sep 17 00:00:00 2001 From: Justin Li Date: Sat, 7 Mar 2015 01:13:15 -0500 Subject: [PATCH] Add inout workaround for GLSL on NVIDIA drivers The NVIDIA GLSL compiler has a discrepancy causing array-typed function arguments declared with the "out" parameter qualifier to not update the caller's input. Whether this is a driver bug or not is debatable. --- SMAA.hlsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SMAA.hlsl b/SMAA.hlsl index 2c8d497..af7c42d 100644 --- a/SMAA.hlsl +++ b/SMAA.hlsl @@ -643,7 +643,7 @@ void SMAAMovc(bool4 cond, inout float4 variable, float4 value) { * Edge Detection Vertex Shader */ void SMAAEdgeDetectionVS(float2 texcoord, - out float4 offset[3]) { + inout float4 offset[3]) { offset[0] = mad(SMAA_RT_METRICS.xyxy, float4(-1.0, 0.0, 0.0, -1.0), texcoord.xyxy); offset[1] = mad(SMAA_RT_METRICS.xyxy, float4( 1.0, 0.0, 0.0, 1.0), texcoord.xyxy); offset[2] = mad(SMAA_RT_METRICS.xyxy, float4(-2.0, 0.0, 0.0, -2.0), texcoord.xyxy); @@ -654,7 +654,7 @@ void SMAAEdgeDetectionVS(float2 texcoord, */ void SMAABlendingWeightCalculationVS(float2 texcoord, out float2 pixcoord, - out float4 offset[3]) { + inout float4 offset[3]) { pixcoord = texcoord * SMAA_RT_METRICS.zw; // We will use these offsets for the searches later on (see @PSEUDO_GATHER4):