From 2ada1c80a36c1d6b4c33be7e2d4c4f296d72aa1c Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 24 Apr 2013 00:01:33 +0200 Subject: [PATCH] Gain a few cycles by not converting colors to LLColor4U over and over again per frame. --- indra/newview/llvowlsky.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp index 9e47dadf78..6ba93ec662 100644 --- a/indra/newview/llvowlsky.cpp +++ b/indra/newview/llvowlsky.cpp @@ -830,12 +830,25 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable) *(texcoordsp++) = LLVector2(1,1); *(texcoordsp++) = LLVector2(1,0); - *(colorsp++) = LLColor4U(mStarColors[vtx]); - *(colorsp++) = LLColor4U(mStarColors[vtx]); - *(colorsp++) = LLColor4U(mStarColors[vtx]); - *(colorsp++) = LLColor4U(mStarColors[vtx]); - *(colorsp++) = LLColor4U(mStarColors[vtx]); - *(colorsp++) = LLColor4U(mStarColors[vtx]); + // Only convert to LLColour4U once + + // *(colorsp++) = LLColor4U(mStarColors[vtx]); + // *(colorsp++) = LLColor4U(mStarColors[vtx]); + // *(colorsp++) = LLColor4U(mStarColors[vtx]); + // *(colorsp++) = LLColor4U(mStarColors[vtx]); + // *(colorsp++) = LLColor4U(mStarColors[vtx]); + // *(colorsp++) = LLColor4U(mStarColors[vtx]); + + LLColor4U color4u(mStarColors[vtx]); + *(colorsp++) = color4u; + *(colorsp++) = color4u; + *(colorsp++) = color4u; + *(colorsp++) = color4u; + *(colorsp++) = color4u; + *(colorsp++) = color4u; + + // + } mStarsVerts->flush();