Optimization pass.

This commit is contained in:
Shyotl
2018-08-07 01:09:53 -05:00
parent 71f3002717
commit d11899561b
25 changed files with 108 additions and 104 deletions

View File

@@ -69,23 +69,6 @@ vec3 decode_normal(vec2 enc);
vec4 getPosition(vec2 pos_screen);
float calcShadow( sampler2DShadow shadowMap, vec4 stc, vec2 res, vec2 pos_screen )
{
//stc.x += (((texture2D(noiseMap, pos_screen/128.0).x)-.5)/shadow_res.x); //Random dither.
vec2 off = vec2(1,1.5)/res;
stc.x = floor(stc.x*res.x + fract(pos_screen.y*(1.0/kern_scale.y)*0.5))*off.x;
float shadow = shadow2D(shadowMap, stc.xyz).x; // cs
shadow += shadow2D(shadowMap, stc.xyz+vec3(off.x*2.0, off.y, 0.0)).x;
shadow += shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x;
shadow += shadow2D(shadowMap, stc.xyz+vec3(-off.x*2.0, off.y, 0.0)).x;
shadow += shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x;
return shadow;
}
float calcShadow( sampler2DShadow shadowMap, vec4 stc, vec2 res, vec2 pos_screen )
{
//stc.x += (((texture2D(noiseMap, pos_screen/128.0).x)-.5)/shadow_res.x); //Random dither.

View File

@@ -1355,16 +1355,10 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if(mShinyInAlpha)
{
GLfloat alpha[4] =
{
0.00f,
0.25f,
0.5f,
0.75f
};
// Singu Note: Avoid casing. Store as LLColor4U.
static const LLColor4U shine_steps(LLColor4(0.f, .25f, .5f, 7.5f));
llassert(tep->getShiny() <= 3);
color.mV[3] = U8 (alpha[tep->getShiny()] * 255);
color.mV[3] = shine_steps.mV[tep->getShiny()];
}
}

View File

@@ -565,7 +565,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if(std::find(LLFloaterBlacklist::blacklist_objects.begin(),
LLFloaterBlacklist::blacklist_objects.end(),fullid) != LLFloaterBlacklist::blacklist_objects.end())
{
LL_INFOS() << "Blacklisted object asset " << fullid.asString() << " blocked." << LL_ENDL;
//LL_INFOS() << "Blacklisted object asset " << fullid.asString() << " blocked." << LL_ENDL;
continue;
}

View File

@@ -5786,7 +5786,6 @@ void LLViewerWindow::calcDisplayScale()
LLVector2 LLViewerWindow::getUIScale() const
{
LL_INFOS() << "getUIScale" << LL_ENDL;
static LLCachedControl<F32> ui_scale_factor("UIScaleFactor");
if (mWindow->getFullscreen())
{

View File

@@ -2647,7 +2647,7 @@ void LLVivoxVoiceClient::sendPositionalUpdate(void)
if(!p->mIsSelf)
{
// scale from the range 0.0-1.0 to vivox volume in the range 0-100
S32 volume = ll_round(p->mVolume / VOLUME_SCALE_VIVOX);
S32 volume = ll_pos_round(p->mVolume / VOLUME_SCALE_VIVOX);
bool mute = p->mOnMuteList;
if(mute)

View File

@@ -216,7 +216,8 @@ LLSkyTex::LLSkyTex() :
void LLSkyTex::init()
{
mSkyData = new LLColor4[sResolution * sResolution];
// Singu Note: Store as unsigned to avoid casting.
mSkyData = new LLColor4U[sResolution * sResolution];
mSkyDirs = new LLVector3[sResolution * sResolution];
for (S32 i = 0; i < 2; ++i)
@@ -286,8 +287,7 @@ void LLSkyTex::create(const F32 brightness)
const S32 basic_offset = (i * sResolution + j);
S32 offset = basic_offset * sComponents;
U32* pix = (U32*)(data + offset);
LLColor4U temp = LLColor4U(mSkyData[basic_offset]);
*pix = temp.mAll;
*pix = mSkyData[basic_offset].mAll;
}
}
createGLImage(sCurrent);

View File

@@ -118,7 +118,8 @@ private:
static S32 sComponents;
LLPointer<LLViewerTexture> mTexture[2];
LLPointer<LLImageRaw> mImageRaw[2];
LLColor4 *mSkyData;
// Singu Note: Store as unsigned to avoid casting.
LLColor4U *mSkyData;
LLVector3 *mSkyDirs; // Cache of sky direction vectors
static S32 sCurrent;
static F32 sInterpVal;

View File

@@ -267,7 +267,7 @@ std::string LLWLAnimator::timeToString(F32 curTime)
// get hours and minutes
hours = (S32) (24.0 * curTime);
curTime -= ((F32) hours / 24.0f);
min = ll_round(24.0f * 60.0f * curTime);
min = ll_pos_round(24.0f * 60.0f * curTime);
// handle case where it's 60
if(min == 60)