From 66fee8ff51503850e15af26f46889ed90cd3f203 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Wed, 25 Dec 2019 18:36:34 +0000 Subject: [PATCH] [dxso] Normalize eyeRay and normal before reflection in TexM3x3Spec --- src/dxso/dxso_compiler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dxso/dxso_compiler.cpp b/src/dxso/dxso_compiler.cpp index 9ee44358..4f49838c 100644 --- a/src/dxso/dxso_compiler.cpp +++ b/src/dxso/dxso_compiler.cpp @@ -2531,6 +2531,8 @@ void DxsoCompiler::emitControlFlowGenericLoop( else eyeRay = emitRegisterLoad(ctx.src[1], vec3Mask).id; + eyeRay = m_module.opNormalize(vec3Type, eyeRay); + normal = m_module.opNormalize(vec3Type, normal); uint32_t reflection = m_module.opReflect(vec3Type, eyeRay, normal); for (uint32_t i = 0; i < 3; i++)