1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Remove unnecessary calls to ShaderCombiner::updateRenderState() and ShaderCombiner::updateFBInfo()

This commit is contained in:
Sergey Lipskiy 2015-04-01 09:03:46 +06:00
parent 3bc6ea258a
commit 2514680670
2 changed files with 7 additions and 5 deletions

View File

@ -700,16 +700,17 @@ void ShaderCombiner::update(bool _bForce) {
_setIUniform(m_uniforms.uTex0, 0, _bForce);
_setIUniform(m_uniforms.uTex1, 1, _bForce);
_setIUniform(m_uniforms.uTexNoise, noiseTexIndex, _bForce);
updateFBInfo(_bForce);
updateRenderState(_bForce);
}
updateRenderState(_bForce);
updateGammaCorrection(_bForce);
updateFogMode(_bForce);
updateDitherMode(_bForce);
updateLOD(_bForce);
updateTextureInfo(_bForce);
updateAlphaTestInfo(_bForce);
updateFBInfo(_bForce);
updateDepthInfo(_bForce);
}

View File

@ -752,6 +752,7 @@ void OGLRender::_prepareDrawTriangle(bool _dma)
_setColorArray();
_setTexCoordArrays();
}
currentCombiner()->updateRenderState();
const bool updateColorArrays = m_bFlatColors != (!RSP.bLLE && (gSP.geometryMode & G_SHADING_SMOOTH) == 0);
if (updateColorArrays)
@ -862,8 +863,8 @@ void OGLRender::drawLine(int _v0, int _v1, float _width)
_updateCullFace();
_updateViewport();
m_renderState = rsLine;
currentCombiner()->updateRenderState();
}
currentCombiner()->updateRenderState();
unsigned short elem[2];
elem[0] = _v0;
@ -889,8 +890,8 @@ void OGLRender::drawRect(int _ulx, int _uly, int _lrx, int _lry, float *_pColor)
if (updateArrays) {
glVertexAttrib4f(SC_COLOR, 0, 0, 0, 0);
glVertexAttribPointer(SC_POSITION, 4, GL_FLOAT, GL_FALSE, sizeof(GLVertex), &m_rect[0].x);
currentCombiner()->updateRenderState();
}
currentCombiner()->updateRenderState();
FrameBuffer * pCurrentBuffer = frameBufferList().getCurrent();
OGLVideo & ogl = video();
@ -1066,8 +1067,8 @@ void OGLRender::drawTexturedRect(const TexturedRectParams & _params)
glVertexAttribPointer(SC_POSITION, 4, GL_FLOAT, GL_FALSE, sizeof(GLVertex), &m_rect[0].x);
glVertexAttribPointer(SC_TEXCOORD0, 2, GL_FLOAT, GL_FALSE, sizeof(GLVertex), &m_rect[0].s0);
glVertexAttribPointer(SC_TEXCOORD1, 2, GL_FLOAT, GL_FALSE, sizeof(GLVertex), &m_rect[0].s1);
currentCombiner()->updateRenderState();
}
currentCombiner()->updateRenderState();
if (RSP.cmd == 0xE4 && texturedRectSpecial != NULL && texturedRectSpecial(_params))
return;