Skip to content
Snippets Groups Projects
Commit 205eb79d authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Fix more deprecated GL rendering issues

parent 49fd3ef2
No related branches found
No related tags found
No related merge requests found
...@@ -606,9 +606,7 @@ void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, con ...@@ -606,9 +606,7 @@ void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, con
normal_strider.copyArray(0, norm.data(), count); normal_strider.copyArray(0, norm.data(), count);
sUtilityBuffer->setBuffer(MAP_VERTEX | MAP_NORMAL); sUtilityBuffer->setBuffer(MAP_VERTEX | MAP_NORMAL);
LLGLSLShader::startProfile();
sUtilityBuffer->drawArrays(mode, 0, pos.size()); sUtilityBuffer->drawArrays(mode, 0, pos.size());
LLGLSLShader::stopProfile(count, mode);
} }
//static //static
...@@ -657,9 +655,7 @@ void LLVertexBuffer::drawElements(U32 mode, const S32 num_vertices, const LLVect ...@@ -657,9 +655,7 @@ void LLVertexBuffer::drawElements(U32 mode, const S32 num_vertices, const LLVect
} }
sUtilityBuffer->setBuffer(mask); sUtilityBuffer->setBuffer(mask);
LLGLSLShader::startProfile();
sUtilityBuffer->draw(mode, num_indices, 0); sUtilityBuffer->draw(mode, num_indices, 0);
LLGLSLShader::stopProfile(num_indices, mode);
} }
void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_offset) const void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_offset) const
......
...@@ -593,16 +593,7 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) ...@@ -593,16 +593,7 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
glPolygonOffset(-1.f, -1.f); glPolygonOffset(-1.f, -1.f);
gGL.multMatrix((F32*) volume->getRelativeXform().mMatrix); gGL.multMatrix((F32*) volume->getRelativeXform().mMatrix);
const LLVolumeFace& vol_face = rigged->getVolumeFace(getTEOffset()); const LLVolumeFace& vol_face = rigged->getVolumeFace(getTEOffset());
LLVertexBuffer::unbind(); LLVertexBuffer::drawElements(LLRender::TRIANGLES,vol_face.mNumVertices, vol_face.mPositions, vol_face.mTexCoords, vol_face.mNumIndices, vol_face.mIndices);
glVertexPointer(3, GL_FLOAT, 16, vol_face.mPositions);
if (vol_face.mTexCoords)
{
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, 8, vol_face.mTexCoords);
}
gGL.syncMatrices();
glDrawElements(GL_TRIANGLES, vol_face.mNumIndices, GL_UNSIGNED_SHORT, vol_face.mIndices);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
} }
} }
} }
......
...@@ -2655,16 +2655,12 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) ...@@ -2655,16 +2655,12 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
if (phys_volume->mHullPoints && phys_volume->mHullIndices) if (phys_volume->mHullPoints && phys_volume->mHullIndices)
{ {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0);
LLVertexBuffer::unbind();
glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints);
gGL.diffuseColor4fv(line_color.mV); gGL.diffuseColor4fv(line_color.mV);
gGL.syncMatrices(); LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mNumHullPoints, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
gGL.diffuseColor4fv(color.mV); gGL.diffuseColor4fv(color.mV);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mNumHullPoints, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
} }
else else
{ {
...@@ -3178,11 +3174,8 @@ void renderRaycast(LLDrawable* drawablep) ...@@ -3178,11 +3174,8 @@ void renderRaycast(LLDrawable* drawablep)
{ {
//render face positions //render face positions
LLVertexBuffer::unbind(); gGL.diffuseColor4f(0.f, 1.f, 1.f, 0.5f);
gGL.diffuseColor4f(0,1,1,0.5f); LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mNumVertices, face.mPositions, NULL, face.mNumIndices, face.mIndices);
glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions);
gGL.syncMatrices();
glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices);
} }
if (!volume->isUnique()) if (!volume->isUnique())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment