Track glEnable states via static refs instead of map lookups.
Sync light state, bound shader, and various gl context states similarly to render matrices. Texture handles now refcounted, as multiple viewer textures could ref the same handle (cubemaps do this) Clean up gl extension loading a bit. Not necessary, but only look for ARB variants if not included in current core version. Removed unused extensions. Use core shader api if supported, else use ARB. (FN signatures are identical. Just doing some pointer substitution to ARB if not core.) Attempt at improving VBO update batching. Subdata updates better batched to gether per-frame. There's probably other stuff I forgot that is in this changeset, too. Todo: Fix lightstate assertion when toggling fullscreen with shaders off.
This commit is contained in:
@@ -134,9 +134,9 @@ void LLHUDText::renderText()
|
||||
return;
|
||||
}
|
||||
|
||||
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
|
||||
LLGLState gls_blend(GL_BLEND, TRUE);
|
||||
LLGLState gls_alpha(GL_ALPHA_TEST, TRUE);
|
||||
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
|
||||
LLGLEnable<GL_BLEND> gls_blend;
|
||||
LLGLEnable<GL_ALPHA_TEST> gls_alpha;
|
||||
|
||||
LLColor4 shadow_color(0.f, 0.f, 0.f, 1.f);
|
||||
F32 alpha_factor = 1.f;
|
||||
@@ -613,12 +613,12 @@ void LLHUDText::markDead()
|
||||
|
||||
void LLHUDText::renderAllHUD()
|
||||
{
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
LLGLState::checkClientArrays();
|
||||
LLGLStateValidator::checkStates();
|
||||
LLGLStateValidator::checkTextureChannels();
|
||||
LLGLStateValidator::checkClientArrays();
|
||||
|
||||
{
|
||||
LLGLEnable color_mat(GL_COLOR_MATERIAL);
|
||||
LLGLEnable<GL_COLOR_MATERIAL> color_mat;
|
||||
LLGLDepthTest depth(GL_FALSE, GL_FALSE);
|
||||
|
||||
VisibleTextObjectIterator text_it;
|
||||
@@ -633,9 +633,9 @@ void LLHUDText::renderAllHUD()
|
||||
|
||||
LLVertexBuffer::unbind();
|
||||
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
LLGLState::checkClientArrays();
|
||||
LLGLStateValidator::checkStates();
|
||||
LLGLStateValidator::checkTextureChannels();
|
||||
LLGLStateValidator::checkClientArrays();
|
||||
}
|
||||
|
||||
void LLHUDText::shiftAll(const LLVector3& offset)
|
||||
|
||||
Reference in New Issue
Block a user