libobs: Remove unnecessary divides from Lanczos

This commit is contained in:
jpark37 2019-08-14 21:36:23 -07:00
parent 6b81f6cd8f
commit 9f5d218e16

View File

@ -112,14 +112,16 @@ float4 DrawLanczos(FragData f_in, bool undistort)
float3 coltap135 = weight3(f_rev_half.y + 0.5);
// Need normalization if divided value near zero
float rowsum = rowtap024.x + rowtap024.y + rowtap024.z;
rowsum += rowtap135.x + rowtap135.y + rowtap135.z;
rowtap024 = rowtap024 / rowsum;
rowtap135 = rowtap135 / rowsum;
float colsum = coltap024.x + coltap024.y + coltap024.z;
colsum += coltap135.x + coltap135.y + coltap135.z;
coltap024 = coltap024 / colsum;
coltap135 = coltap135 / colsum;
float rowsum = rowtap024.x + rowtap024.y + rowtap024.z +
rowtap135.x + rowtap135.y + rowtap135.z;
float rowsum_i = 1.0 / rowsum;
rowtap024 = rowtap024 * rowsum_i;
rowtap135 = rowtap135 * rowsum_i;
float colsum = coltap024.x + coltap024.y + coltap024.z +
coltap135.x + coltap135.y + coltap135.z;
float colsum_i = 1.0 / colsum;
coltap024 = coltap024 * colsum_i;
coltap135 = coltap135 * colsum_i;
float2 uv0 = (-2.5 - f) * stepxy + pos;
float2 uv1 = uv0 + stepxy;