From 130a7abec54338a1aece2abf2bac44e9344b2870 Mon Sep 17 00:00:00 2001 From: brimson Date: Sat, 9 Jul 2022 02:51:04 -0700 Subject: [PATCH] Use linear epsilon scaling --- shaders/cMotionBlur.fx | 2 +- shaders/cOpticalFlowLK.fx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shaders/cMotionBlur.fx b/shaders/cMotionBlur.fx index d6f0b8d..22be01c 100644 --- a/shaders/cMotionBlur.fx +++ b/shaders/cMotionBlur.fx @@ -338,7 +338,7 @@ namespace OpticalFlowLK S[3] = tex2D(Sample_Common_1_B, TexCoord.zy).xy; // A.x = Ix^2 (A11); A.y = Iy^2 (A22); A.z = IxIy (A12) - float3 A = float3(FP16_MINIMUM, FP16_MINIMUM, 0.0) * pow(4.0, Level); + float3 A = ldexp(float3(FP16_MINIMUM, FP16_MINIMUM, 0.0), Level); A += (S[0].xyx * S[0].xyy); A += (S[1].xyx * S[1].xyy); A += (S[2].xyx * S[2].xyy); diff --git a/shaders/cOpticalFlowLK.fx b/shaders/cOpticalFlowLK.fx index cb64862..c3d1237 100644 --- a/shaders/cOpticalFlowLK.fx +++ b/shaders/cOpticalFlowLK.fx @@ -331,7 +331,7 @@ namespace OpticalFlowLK S[3] = tex2D(Sample_Common_1_B, TexCoord.zy).xy; // A.x = Ix^2 (A11); A.y = Iy^2 (A22); A.z = IxIy (A12) - float3 A = float3(FP16_MINIMUM, FP16_MINIMUM, 0.0) * pow(4.0, Level); + float3 A = ldexp(float3(FP16_MINIMUM, FP16_MINIMUM, 0.0), Level); A += (S[0].xyx * S[0].xyy); A += (S[1].xyx * S[1].xyy); A += (S[2].xyx * S[2].xyy);