From a414abfe4a55ab9dc97c257f72c60252ec3daaed Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 24 Mar 2014 22:57:58 -0700 Subject: [PATCH] Don't calculate lighting when not enabled. We just ignore it anyway. 2% improvement in Tales of Phantasia X. --- GPU/GLES/SoftwareTransform.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/GPU/GLES/SoftwareTransform.cpp b/GPU/GLES/SoftwareTransform.cpp index 5fdeffab87..a2e6125991 100644 --- a/GPU/GLES/SoftwareTransform.cpp +++ b/GPU/GLES/SoftwareTransform.cpp @@ -398,11 +398,12 @@ void TransformDrawEngine::SoftwareTransformAndDraw( } else { unlitColor = Vec4f::FromRGBA(gstate.getMaterialAmbientRGBA()); } - float litColor0[4]; - float litColor1[4]; - lighter.Light(litColor0, litColor1, unlitColor.AsArray(), out, normal); if (gstate.isLightingEnabled()) { + float litColor0[4]; + float litColor1[4]; + lighter.Light(litColor0, litColor1, unlitColor.AsArray(), out, normal); + // Don't ignore gstate.lmode - we should send two colors in that case for (int j = 0; j < 4; j++) { c0[j] = litColor0[j];