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:
@@ -576,8 +576,8 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
|
||||
LLRiggedVolume* rigged = volume->getRiggedVolume();
|
||||
if (rigged)
|
||||
{
|
||||
LLGLEnable offset(GL_POLYGON_OFFSET_FILL);
|
||||
glPolygonOffset(-1.f, -1.f);
|
||||
LLGLEnable<GL_POLYGON_OFFSET_FILL> offset;
|
||||
gGL.setPolygonOffset(-1.f, -1.f);
|
||||
gGL.multMatrix(volume->getRelativeXform());
|
||||
const LLVolumeFace& vol_face = rigged->getVolumeFace(getTEOffset());
|
||||
|
||||
@@ -620,8 +620,8 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
|
||||
else
|
||||
{
|
||||
gGL.diffuseColor4fv(color.mV);
|
||||
LLGLEnable poly_offset(GL_POLYGON_OFFSET_FILL);
|
||||
glPolygonOffset(-1.f,-1.f);
|
||||
LLGLEnable<GL_POLYGON_OFFSET_FILL> poly_offset;
|
||||
gGL.setPolygonOffset(-1.f,-1.f);
|
||||
// Singu Note: Disable per-vertex color to prevent fixed-function pipeline from using it. We want glColor color, not vertex color!
|
||||
mVertexBuffer->setBuffer(mVertexBuffer->getTypeMask() & ~(LLVertexBuffer::MAP_COLOR));
|
||||
mVertexBuffer->draw(LLRender::TRIANGLES, mIndicesCount, mIndicesIndex);
|
||||
|
||||
Reference in New Issue
Block a user