summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2023-09-10 10:17:43 +0800
committerErik Kundiman <erik@megapahit.org>2023-09-10 10:17:43 +0800
commit040fe22d93fe67a73fc33493057f06f07371dbdd (patch)
treea392cc84a82826652a0d92a005bc5aaf48dabc86 /indra
parente67022465d8189eb30135b6b7c0fe477b3b91819 (diff)
Preprocess non portable OpenGL code
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lldrawpool.cpp2
-rw-r--r--indra/newview/lldrawpoolbump.cpp2
-rw-r--r--indra/newview/lldrawpoolsimple.cpp6
-rw-r--r--indra/newview/lldrawpoolsky.cpp2
-rw-r--r--indra/newview/lldrawpoolterrain.cpp26
-rw-r--r--indra/newview/lldrawpooltree.cpp2
-rw-r--r--indra/newview/lldrawpoolwater.cpp16
-rw-r--r--indra/newview/llface.cpp14
-rw-r--r--indra/newview/llfloaterimagepreview.cpp2
-rw-r--r--indra/newview/llhudnametag.cpp2
-rw-r--r--indra/newview/llhudtext.cpp4
-rw-r--r--indra/newview/llmaniprotate.cpp4
-rw-r--r--indra/newview/llmanipscale.cpp2
-rw-r--r--indra/newview/llmaniptranslate.cpp6
-rw-r--r--indra/newview/llmodelpreview.cpp20
-rw-r--r--indra/newview/llselectmgr.cpp8
-rw-r--r--indra/newview/llspatialpartition.cpp50
-rw-r--r--indra/newview/llviewerdisplay.cpp4
-rw-r--r--indra/newview/llviewerjointmesh.cpp2
-rw-r--r--indra/newview/llvoavatar.cpp8
-rw-r--r--indra/newview/pipeline.cpp52
21 files changed, 234 insertions, 0 deletions
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp
index 3fd15d36df..f010a98404 100644
--- a/indra/newview/lldrawpool.cpp
+++ b/indra/newview/lldrawpool.cpp
@@ -365,7 +365,9 @@ void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4& color)
void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4U& color)
{
+#if GL_VERSION_1_1
glColor4ubv(color.mV);
+#endif
}
void LLFacePool::LLOverrideFaceColor::setColor(F32 r, F32 g, F32 b, F32 a)
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index cc454417c6..dafc4a0a0a 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -666,7 +666,9 @@ void LLDrawPoolBump::beginBump()
void LLDrawPoolBump::renderBump(U32 pass)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_BUMP);
+#if GL_VERSION_1_1
LLGLDisable fog(GL_FOG);
+#endif
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_LEQUAL);
LLGLEnable blend(GL_BLEND);
gGL.diffuseColor4f(1,1,1,1);
diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp
index e324a663f4..12d8ec081b 100644
--- a/indra/newview/lldrawpoolsimple.cpp
+++ b/indra/newview/lldrawpoolsimple.cpp
@@ -87,7 +87,9 @@ void LLDrawPoolGlow::render(LLGLSLShader* shader)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_GLOW);
LLGLEnable blend(GL_BLEND);
+#if GL_VERSION_1_1
LLGLDisable test(GL_ALPHA_TEST);
+#endif
gGL.flush();
/// Get rid of z-fighting with non-glow pass.
LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
@@ -289,7 +291,9 @@ void LLDrawPoolSimple::renderDeferred(S32 pass)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_SIMPLE_DEFERRED);
LLGLDisable blend(GL_BLEND);
+#if GL_VERSION_1_1
LLGLDisable alpha_test(GL_ALPHA_TEST);
+#endif
//render static
setup_simple_shader(&gDeferredDiffuseProgram);
@@ -386,7 +390,9 @@ void LLDrawPoolGrass::render(S32 pass)
{
//LL_RECORD_BLOCK_TIME(FTM_RENDER_GRASS);
+#if GL_VERSION_1_1
LLGLEnable test(GL_ALPHA_TEST);
+#endif
gGL.setSceneBlendType(LLRender::BT_ALPHA);
//render grass
LLRenderPass::pushBatches(LLRenderPass::PASS_GRASS, getVertexDataMask());
diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp
index 3a1efec91b..ffcd7835ee 100644
--- a/indra/newview/lldrawpoolsky.cpp
+++ b/indra/newview/lldrawpoolsky.cpp
@@ -81,7 +81,9 @@ void LLDrawPoolSky::render(S32 pass)
LLGLSPipelineDepthTestSkyBox gls_skybox(true, false);
+#if GL_VERSION_1_1
LLGLEnable fog_enable( (mShaderLevel < 1 && LLViewerCamera::getInstance()->cameraUnderWater()) ? GL_FOG : 0);
+#endif
gGL.pushMatrix();
LLVector3 origin = LLViewerCamera::getInstance()->getOrigin();
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index cc5cb667f0..c59adc2cf3 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -459,6 +459,7 @@ void LLDrawPoolTerrain::renderFull4TU()
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->bind(detail_texture0p);
+#if GL_VERSION_1_1
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
@@ -466,6 +467,7 @@ void LLDrawPoolTerrain::renderFull4TU()
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
+#endif
//
// Stage 1: Generate alpha ramp for detail0/detail1 transition
@@ -482,12 +484,14 @@ void LLDrawPoolTerrain::renderFull4TU()
gGL.getTexUnit(2)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(2)->activate();
+#if GL_VERSION_1_1
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
+#endif
//
// Stage 3: Modulate with primary (vertex) color for lighting
@@ -509,12 +513,14 @@ void LLDrawPoolTerrain::renderFull4TU()
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->bind(detail_texture3p);
+#if GL_VERSION_1_1
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
+#endif
//
// Stage 1: Generate alpha ramp for detail2/detail3 transition
@@ -535,12 +541,14 @@ void LLDrawPoolTerrain::renderFull4TU()
gGL.getTexUnit(2)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(2)->activate();
+#if GL_VERSION_1_1
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
+#endif
//
// Stage 3: Generate alpha ramp for detail1/detail2 transition
@@ -575,8 +583,10 @@ void LLDrawPoolTerrain::renderFull4TU()
gGL.getTexUnit(2)->disable();
gGL.getTexUnit(2)->activate();
+#if GL_VERSION_1_1
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
+#endif
gGL.matrixMode(LLRender::MM_TEXTURE);
gGL.loadIdentity();
gGL.matrixMode(LLRender::MM_MODELVIEW);
@@ -599,8 +609,10 @@ void LLDrawPoolTerrain::renderFull4TU()
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+#if GL_VERSION_1_1
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
+#endif
gGL.matrixMode(LLRender::MM_TEXTURE);
gGL.loadIdentity();
gGL.matrixMode(LLRender::MM_MODELVIEW);
@@ -634,6 +646,7 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 0: Render detail 0 into base
//
gGL.getTexUnit(0)->bind(detail_texture0p);
+#if GL_VERSION_1_1
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
@@ -641,6 +654,7 @@ void LLDrawPoolTerrain::renderFull2TU()
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
+#endif
drawLoop();
@@ -652,8 +666,10 @@ void LLDrawPoolTerrain::renderFull2TU()
//
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep);
+#if GL_VERSION_1_1
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
+#endif
//
// Stage 1: Write detail1
@@ -662,12 +678,14 @@ void LLDrawPoolTerrain::renderFull2TU()
gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(1)->activate();
+#if GL_VERSION_1_1
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
+#endif
gGL.getTexUnit(0)->activate();
{
@@ -695,12 +713,14 @@ void LLDrawPoolTerrain::renderFull2TU()
gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(1)->activate();
+#if GL_VERSION_1_1
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
+#endif
{
LLGLEnable blend(GL_BLEND);
@@ -726,12 +746,14 @@ void LLDrawPoolTerrain::renderFull2TU()
gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(1)->activate();
+#if GL_VERSION_1_1
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
+#endif
gGL.getTexUnit(0)->activate();
{
@@ -748,8 +770,10 @@ void LLDrawPoolTerrain::renderFull2TU()
gGL.getTexUnit(1)->disable();
gGL.getTexUnit(1)->activate();
+#if GL_VERSION_1_1
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
+#endif
gGL.matrixMode(LLRender::MM_TEXTURE);
gGL.loadIdentity();
gGL.matrixMode(LLRender::MM_MODELVIEW);
@@ -760,8 +784,10 @@ void LLDrawPoolTerrain::renderFull2TU()
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+#if GL_VERSION_1_1
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
+#endif
gGL.matrixMode(LLRender::MM_TEXTURE);
gGL.loadIdentity();
gGL.matrixMode(LLRender::MM_MODELVIEW);
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index facfb235c9..bc6f587a3c 100644
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -90,7 +90,9 @@ void LLDrawPoolTree::render(S32 pass)
return;
}
+#if GL_VERSION_1_1
LLGLState test(GL_ALPHA_TEST, 0);
+#endif
gGL.getTexUnit(sDiffTex)->bindFast(mTexturep);
gPipeline.touchTexture(mTexturep, 1024.f * 1024.f); // <=== keep Linden tree textures at full res
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index a84f62036e..45b5c9509b 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -227,17 +227,21 @@ void LLDrawPoolWater::render(S32 pass)
gGL.diffuseColor4fv(water_color.mV);
// Automatically generate texture coords for detail map
+#if GL_VERSION_1_1
glEnable(GL_TEXTURE_GEN_S); //texture unit 1
glEnable(GL_TEXTURE_GEN_T); //texture unit 1
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
+#endif
// Slowly move over time.
F32 offset = fmod(gFrameTimeSeconds*2.f, 100.f);
F32 tp0[4] = {16.f/256.f, 0.0f, 0.0f, offset*0.01f};
F32 tp1[4] = {0.0f, 16.f/256.f, 0.0f, offset*0.01f};
+#if GL_VERSION_1_1
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1);
+#endif
gGL.getTexUnit(0)->activate();
@@ -264,15 +268,19 @@ void LLDrawPoolWater::render(S32 pass)
gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(1)->disable();
+#if GL_VERSION_1_1
glDisable(GL_TEXTURE_GEN_S); //texture unit 1
glDisable(GL_TEXTURE_GEN_T); //texture unit 1
+#endif
gGL.getTexUnit(2)->activate();
gGL.getTexUnit(2)->unbind(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(2)->disable();
+#if GL_VERSION_1_1
glDisable(GL_TEXTURE_GEN_S); //texture unit 1
glDisable(GL_TEXTURE_GEN_T); //texture unit 1
+#endif
// Disable texture coordinate and color arrays
gGL.getTexUnit(0)->activate();
@@ -376,10 +384,12 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
// Automatically generate texture coords for water texture
if (!shader)
{
+#if GL_VERSION_1_1
glEnable(GL_TEXTURE_GEN_S); //texture unit 0
glEnable(GL_TEXTURE_GEN_T); //texture unit 0
glTexGenf(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGenf(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
+#endif
}
// Use the fact that we know all water faces are the same size
@@ -405,8 +415,10 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
if (!shader)
{
+#if GL_VERSION_1_1
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1);
+#endif
}
else
{
@@ -433,8 +445,10 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
if (!shader)
{
// Reset the settings back to expected values
+#if GL_VERSION_1_1
glDisable(GL_TEXTURE_GEN_S); //texture unit 0
glDisable(GL_TEXTURE_GEN_T); //texture unit 0
+#endif
}
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -462,7 +476,9 @@ void LLDrawPoolWater::renderReflection(LLFace* face)
return;
}
+#if GL_VERSION_1_1
LLGLSNoFog noFog;
+#endif
gGL.getTexUnit(0)->bind((dr == 0) ? voskyp->getSunTex() : voskyp->getMoonTex());
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 6619f7d0bd..85abec6cc8 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -579,16 +579,22 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
gGL.multMatrix((F32*) volume->getRelativeXform().mMatrix);
const LLVolumeFace& vol_face = rigged->getVolumeFace(getTEOffset());
LLVertexBuffer::unbind();
+#if GL_VERSION_1_1
glVertexPointer(3, GL_FLOAT, 16, vol_face.mPositions);
+#endif
if (vol_face.mTexCoords)
{
+#if GL_VERSION_1_1
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, 8, vol_face.mTexCoords);
+#endif
}
gGL.syncMatrices();
LL_PROFILER_GPU_ZONEC( "gl.DrawElements", 0x00FF00 );
glDrawElements(GL_TRIANGLES, vol_face.mNumIndices, GL_UNSIGNED_SHORT, vol_face.mIndices);
+#if GL_VERSION_1_1
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+#endif
}
}
}
@@ -644,13 +650,17 @@ void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wirefram
}
else
{
+#if GL_VERSION_1_1
LLGLEnable fog(GL_FOG);
glFogi(GL_FOG_MODE, GL_LINEAR);
+#endif
float d = (LLViewerCamera::getInstance()->getPointOfInterest() - LLViewerCamera::getInstance()->getOrigin()).magVec();
LLColor4 fogCol = color * fogCfx;
+#if GL_VERSION_1_1
glFogf(GL_FOG_START, d);
glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV())));
glFogfv(GL_FOG_COLOR, fogCol.mV);
+#endif
gGL.flush();
{
@@ -675,10 +685,14 @@ void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wirefram
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
}
+#if GL_VERSION_1_1
LLGLEnable offset(GL_POLYGON_OFFSET_LINE);
+#endif
glPolygonOffset(3.f, 3.f);
glLineWidth(5.f);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
renderFace(mDrawablep, this);
}
}
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index 89ba687d25..a31f709969 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -251,7 +251,9 @@ void LLFloaterImagePreview::draw()
if (selected <= 0)
{
gl_rect_2d_checkerboard(mPreviewRect);
+#if GL_VERSION_1_1
LLGLDisable gls_alpha(GL_ALPHA_TEST);
+#endif
if(mImagep.notNull())
{
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp
index ab6a64157c..d75d341c69 100644
--- a/indra/newview/llhudnametag.cpp
+++ b/indra/newview/llhudnametag.cpp
@@ -258,7 +258,9 @@ void LLHUDNameTag::renderText(BOOL for_select)
}
LLGLState gls_blend(GL_BLEND, for_select ? FALSE : TRUE);
+#if GL_VERSION_1_1
LLGLState gls_alpha(GL_ALPHA_TEST, for_select ? FALSE : TRUE);
+#endif
LLColor4 shadow_color(0.f, 0.f, 0.f, 1.f);
F32 alpha_factor = 1.f;
diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp
index 5952edfc44..75cfb45555 100644
--- a/indra/newview/llhudtext.cpp
+++ b/indra/newview/llhudtext.cpp
@@ -117,7 +117,9 @@ void LLHUDText::renderText()
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
LLGLState gls_blend(GL_BLEND, TRUE);
+#if GL_VERSION_1_1
LLGLState gls_alpha(GL_ALPHA_TEST, TRUE);
+#endif
LLColor4 shadow_color(0.f, 0.f, 0.f, 1.f);
F32 alpha_factor = 1.f;
@@ -572,7 +574,9 @@ void LLHUDText::renderAllHUD()
LLGLState::checkTextureChannels();
{
+#if GL_VERSION_1_1
LLGLEnable color_mat(GL_COLOR_MATERIAL);
+#endif
LLGLDepthTest depth(GL_FALSE, GL_FALSE);
VisibleTextObjectIterator text_it;
diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp
index d85a846f4d..2f332e86cf 100644
--- a/indra/newview/llmaniprotate.cpp
+++ b/indra/newview/llmaniprotate.cpp
@@ -118,7 +118,9 @@ void LLManipRotate::render()
gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep);
LLGLDepthTest gls_depth(GL_TRUE);
LLGLEnable gl_blend(GL_BLEND);
+#if GL_VERSION_1_1
LLGLEnable gls_alpha_test(GL_ALPHA_TEST);
+#endif
// You can rotate if you can move
LLViewerObject* first_object = mObjectSelection->getFirstMoveableObject(TRUE);
@@ -275,7 +277,9 @@ void LLManipRotate::render()
}
LLGLEnable cull_face(GL_CULL_FACE);
+#if GL_VERSION_1_1
LLGLEnable clip_plane0(GL_CLIP_PLANE0);
+#endif
LLGLDepthTest gls_depth(GL_FALSE);
LLGLDisable gls_stencil(GL_STENCIL_TEST);
diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp
index e74fd1241b..a28118ff23 100644
--- a/indra/newview/llmanipscale.cpp
+++ b/indra/newview/llmanipscale.cpp
@@ -212,7 +212,9 @@ void LLManipScale::render()
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
LLGLDepthTest gls_depth(GL_TRUE);
LLGLEnable gl_blend(GL_BLEND);
+#if GL_VERSION_1_1
LLGLEnable gls_alpha_test(GL_ALPHA_TEST);
+#endif
LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
if( canAffectSelection() )
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index 0b2a1ef389..8d1476e418 100644
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -1541,7 +1541,9 @@ void LLManipTranslate::renderSnapGuides()
}
{
+#if GL_VERSION_1_1
LLGLDisable alpha_test(GL_ALPHA_TEST);
+#endif
//draw black overlay
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
renderGrid(u,v,tiles,0.0f, 0.0f, 0.0f,a*0.16f);
@@ -1562,7 +1564,9 @@ void LLManipTranslate::renderSnapGuides()
{
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GREATER);
+#if GL_VERSION_1_1
LLGLEnable stipple(GL_LINE_STIPPLE);
+#endif
gGL.flush();
switch (mManipPart)
@@ -2184,7 +2188,9 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
LLGLEnable gls_blend(GL_BLEND);
+#if GL_VERSION_1_1
LLGLEnable gls_color_material(GL_COLOR_MATERIAL);
+#endif
for (S32 pass = 1; pass <= 2; pass++)
{
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp
index cfc30e49a1..858a3c3827 100644
--- a/indra/newview/llmodelpreview.cpp
+++ b/indra/newview/llmodelpreview.cpp
@@ -3063,7 +3063,9 @@ BOOL LLModelPreview::render()
LLGLDisable no_blend(GL_BLEND);
LLGLEnable cull(GL_CULL_FACE);
LLGLDepthTest depth(GL_FALSE); // SL-12781 disable z-buffer to render background color
+#if GL_VERSION_1_1
LLGLDisable fog(GL_FOG);
+#endif
{
gUIProgram.bind();
@@ -3267,7 +3269,9 @@ BOOL LLModelPreview::render()
const U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0;
+#if GL_VERSION_1_1
LLGLEnable normalize(GL_NORMALIZE);
+#endif
if (!mBaseModel.empty() && mVertexBuffer[5].empty())
{
@@ -3361,9 +3365,13 @@ BOOL LLModelPreview::render()
if (edges)
{
glLineWidth(PREVIEW_EDGE_WIDTH);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
glLineWidth(1.f);
}
buffer->flush();
@@ -3485,10 +3493,14 @@ BOOL LLModelPreview::render()
gGL.diffuseColor4fv(PREVIEW_PSYH_EDGE_COL.mV);
glLineWidth(PREVIEW_PSYH_EDGE_WIDTH);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
glLineWidth(1.f);
buffer->flush();
@@ -3502,7 +3514,9 @@ BOOL LLModelPreview::render()
if (mHasDegenerate)
{
glLineWidth(PREVIEW_DEG_EDGE_WIDTH);
+#if GL_VERSION_1_1
glPointSize(PREVIEW_DEG_POINT_SIZE);
+#endif
gPipeline.enableLightsFullbright();
//show degenerate triangles
LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS);
@@ -3571,7 +3585,9 @@ BOOL LLModelPreview::render()
gGL.popMatrix();
}
glLineWidth(1.f);
+#if GL_VERSION_1_1
glPointSize(1.f);
+#endif
gPipeline.enableLightsPreview();
gGL.setSceneBlendType(LLRender::BT_ALPHA);
}
@@ -3712,9 +3728,13 @@ BOOL LLModelPreview::render()
{
gGL.diffuseColor4fv(PREVIEW_EDGE_COL.mV);
glLineWidth(PREVIEW_EDGE_WIDTH);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
glLineWidth(1.f);
}
}
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 195b172102..cab0b74cd0 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -6140,7 +6140,9 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
}
}
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
S32 num_tes = llmin((S32)objectp->getNumTEs(), (S32)objectp->getNumFaces()); // avatars have TEs but no faces
for (S32 te = 0; te < num_tes; ++te)
@@ -6155,7 +6157,9 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
gGL.popMatrix();
glLineWidth(1.f);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
if (shader)
{
@@ -6731,13 +6735,17 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
{
gGL.flush();
gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE);
+#if GL_VERSION_1_1
LLGLEnable fog(GL_FOG);
glFogi(GL_FOG_MODE, GL_LINEAR);
+#endif
float d = (LLViewerCamera::getInstance()->getPointOfInterest()-LLViewerCamera::getInstance()->getOrigin()).magVec();
LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal()-gAgentCamera.getCameraPositionGlobal()).magVec()/(LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0);
+#if GL_VERSION_1_1
glFogf(GL_FOG_START, d);
glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV())));
glFogfv(GL_FOG_COLOR, fogCol.mV);
+#endif
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL);
gGL.flush();
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 52eef0e92f..18eccea066 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -1788,7 +1788,9 @@ void renderOctree(LLSpatialGroup* group)
gGL.popMatrix();
}
}
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
gDebugProgram.bind(); // make sure non-rigged variant is bound
gGL.diffuseColor4f(1,1,1,1);
}
@@ -2122,7 +2124,9 @@ void renderComplexityDisplay(LLDrawable* drawablep)
// don't highlight objects below the threshold
if (cost > gSavedSettings.getS32("RenderComplexityThreshold"))
{
+#if GL_VERSION_1_1
glColor4f(color[0],color[1],color[2],0.5f);
+#endif
S32 num_faces = drawablep->getNumFaces();
@@ -2393,10 +2397,14 @@ void renderMeshBaseHull(LLVOVolume* volume, U32 data_mask, LLColor4& color, LLCo
gGL.diffuseColor4fv(color.mV);
LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mBaseHullMesh.mPositions);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
gGL.diffuseColor4fv(line_color.mV);
LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mBaseHullMesh.mPositions);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
}
else
{
@@ -2417,12 +2425,16 @@ void render_hull(LLModel::PhysicsMesh& mesh, const LLColor4& color, const LLColo
{
gGL.diffuseColor4fv(color.mV);
LLVertexBuffer::drawArrays(LLRender::TRIANGLES, mesh.mPositions);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
glLineWidth(3.f);
gGL.diffuseColor4fv(line_color.mV);
LLVertexBuffer::drawArrays(LLRender::TRIANGLES, mesh.mPositions);
glLineWidth(1.f);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
}
void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
@@ -2475,7 +2487,9 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
gGL.pushMatrix();
gGL.multMatrix((F32*) volume->getRelativeXform().mMatrix);
+#if GL_VERSION_1_1
LLGLEnable(GL_POLYGON_OFFSET_LINE);
+#endif
glPolygonOffset(3.f, 3.f);
if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::USER_MESH)
@@ -2507,10 +2521,14 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
gGL.diffuseColor4fv(color.mV);
LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
gGL.diffuseColor4fv(line_color.mV);
LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
}
else
{ //no mesh or decomposition, render base hull
@@ -2631,7 +2649,9 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
{
//render hull
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
gGL.diffuseColor4fv(line_color.mV);
LLVertexBuffer::unbind();
@@ -2641,7 +2661,9 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
gGL.diffuseColor4fv(color.mV);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
}
@@ -2698,13 +2720,17 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
S32 detail = get_physics_detail(volume_params, volume->getScale());
LLVolume* phys_volume = LLPrimitive::sVolumeManager->refVolume(volume_params, detail);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
gGL.diffuseColor4fv(line_color.mV);
pushVerts(phys_volume);
gGL.diffuseColor4fv(color.mV);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
pushVerts(phys_volume);
LLPrimitive::sVolumeManager->unrefVolume(phys_volume);
}
@@ -2717,10 +2743,14 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
if (phys_volume->mHullPoints && phys_volume->mHullIndices)
{
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
llassert(LLGLSLShader::sCurBoundShader != 0);
LLVertexBuffer::unbind();
+#if GL_VERSION_1_1
glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints);
+#endif
gGL.diffuseColor4fv(line_color.mV);
gGL.syncMatrices();
{
@@ -2729,7 +2759,9 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
}
gGL.diffuseColor4fv(color.mV);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
{
LL_PROFILER_GPU_ZONEC( "gl.DrawElements", 0x40FF40 )
glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
@@ -2811,14 +2843,18 @@ void renderPhysicsShapes(LLSpatialGroup* group)
LLVertexBuffer* buff = face->getVertexBuffer();
if (buff)
{
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
gGL.diffuseColor3f(0.2f, 0.5f, 0.3f);
buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0);
gGL.diffuseColor3f(0.2f, 1.f, 0.3f);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0);
}
}
@@ -2923,7 +2959,9 @@ void renderTextureAnim(LLDrawInfo* params)
void renderBatchSize(LLDrawInfo* params)
{
+#if GL_VERSION_1_1
LLGLEnable offset(GL_POLYGON_OFFSET_FILL);
+#endif
glPolygonOffset(-1.f, 1.f);
LLGLSLShader* old_shader = LLGLSLShader::sCurBoundShaderPtr;
U32 mask = LLVertexBuffer::MAP_VERTEX;
@@ -3262,13 +3300,17 @@ void renderRaycast(LLDrawable* drawablep)
dir.setSub(end, start);
gGL.flush();
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
{
//render face positions
LLVertexBuffer::unbind();
gGL.diffuseColor4f(0,1,1,0.5f);
+#if GL_VERSION_1_1
glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions);
+#endif
gGL.syncMatrices();
LL_PROFILER_GPU_ZONEC( "gl.DrawElements", 0x60FF60 );
glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices);
@@ -3289,7 +3331,9 @@ void renderRaycast(LLDrawable* drawablep)
}
gGL.popMatrix();
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
}
}
}
@@ -3860,16 +3904,22 @@ void LLSpatialPartition::renderDebug()
LLGLEnable blend(GL_BLEND);
LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
gGL.diffuseColor4f(0.5f, 0.0f, 0, 0.25f);
+#if GL_VERSION_1_1
LLGLEnable offset(GL_POLYGON_OFFSET_LINE);
+#endif
glPolygonOffset(-1.f, -1.f);
LLOctreeRenderXRay xray(camera);
xray.traverse(mOctree);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
}
}
gDebugProgram.unbind();
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index b40cf4acec..6dbd728461 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -899,7 +899,9 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
{
glClearColor(0.5f, 0.5f, 0.5f, 0.f);
glClear(GL_COLOR_BUFFER_BIT);
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
}
LLAppViewer::instance()->pingMainloopTimeout("Display:RenderStart");
@@ -1490,7 +1492,9 @@ void render_ui_2d()
// Render 2D UI elements that overlay the world (no z compare)
// Disable wireframe mode below here, as this is HUD/menus
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
// Menu overlays, HUD, etc
gViewerWindow->setup2DRender();
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index d9cdde8d6d..d5231b49be 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -257,7 +257,9 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
stop_glerror();
+#if GL_VERSION_1_1
LLGLSSpecular specular(LLColor4(1.f,1.f,1.f,1.f), 0.f);
+#endif
//----------------------------------------------------------------
// setup current texture
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 305c489cc8..4a53f2b2cd 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -5107,7 +5107,9 @@ U32 LLVOAvatar::renderSkinned()
//--------------------------------------------------------------------
bool should_alpha_mask = shouldAlphaMask();
+#if GL_VERSION_1_1
LLGLState test(GL_ALPHA_TEST, should_alpha_mask);
+#endif
BOOL first_pass = TRUE;
if (!LLDrawPoolAvatar::sSkipOpaque)
@@ -5158,7 +5160,9 @@ U32 LLVOAvatar::renderSkinned()
if (!LLDrawPoolAvatar::sSkipTransparent || LLPipeline::sImpostorRender)
{
LLGLState blend(GL_BLEND, !mIsDummy);
+#if GL_VERSION_1_1
LLGLState test(GL_ALPHA_TEST, !mIsDummy);
+#endif
num_indices += renderTransparent(first_pass);
}
@@ -5237,7 +5241,9 @@ U32 LLVOAvatar::renderRigid()
}
bool should_alpha_mask = shouldAlphaMask();
+#if GL_VERSION_1_1
LLGLState test(GL_ALPHA_TEST, should_alpha_mask);
+#endif
if (isTextureVisible(TEX_EYES_BAKED) || (getOverallAppearance() == AOA_JELLYDOLL && !isControlAvatar()) || isUIAvatar())
{
@@ -5302,7 +5308,9 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel)
gGL.flush();
}
{
+#if GL_VERSION_1_1
LLGLEnable test(GL_ALPHA_TEST);
+#endif
gGL.flush();
gGL.color4ubv(color.mV);
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index fa5a9c97eb..1a465763e3 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -2382,7 +2382,9 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, LLPlane* pla
gGL.loadMatrix(gGLLastModelView);
LLGLDisable blend(GL_BLEND);
+#if GL_VERSION_1_1
LLGLDisable test(GL_ALPHA_TEST);
+#endif
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
@@ -2633,7 +2635,9 @@ void LLPipeline::doOcclusion(LLCamera& camera)
gGL.setColorMask(false, false);
}
LLGLDisable blend(GL_BLEND);
+#if GL_VERSION_1_1
LLGLDisable test(GL_ALPHA_TEST);
+#endif
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
@@ -4000,7 +4004,9 @@ void render_hud_elements()
LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; //LL_RECORD_BLOCK_TIME(FTM_RENDER_UI);
gPipeline.disableLights();
+#if GL_VERSION_1_1
LLGLDisable fog(GL_FOG);
+#endif
LLGLSUIDefault gls_ui;
LLGLEnable stencil(GL_STENCIL_TEST);
@@ -4054,14 +4060,18 @@ void LLPipeline::renderHighlights()
// Render highlighted faces.
LLGLSPipelineAlpha gls_pipeline_alpha;
LLColor4 color(1.f, 1.f, 1.f, 0.5f);
+#if GL_VERSION_1_1
LLGLEnable color_mat(GL_COLOR_MATERIAL);
+#endif
disableLights();
if (!hasRenderType(LLPipeline::RENDER_TYPE_HUD) && !mHighlightSet.empty())
{ //draw blurry highlight image over screen
LLGLEnable blend(GL_BLEND);
LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS);
+#if GL_VERSION_1_1
LLGLDisable test(GL_ALPHA_TEST);
+#endif
LLGLEnable stencil(GL_STENCIL_TEST);
gGL.flush();
@@ -4325,14 +4335,18 @@ void LLPipeline::renderGeom(LLCamera& camera, bool forceVBOUpdate)
LLGLSPipeline gls_pipeline;
LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0);
+#if GL_VERSION_1_1
LLGLState gls_color_material(GL_COLOR_MATERIAL, mLightingDetail < 2);
+#endif
// Toggle backface culling for debugging
LLGLEnable cull_face(mBackfaceCull ? GL_CULL_FACE : 0);
// Set fog
bool use_fog = hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOG);
+#if GL_VERSION_1_1
LLGLEnable fog_enable(use_fog &&
!gPipeline.canUseWindLightShadersOnObjects() ? GL_FOG : 0);
+#endif
gSky.updateFog(camera.getFar());
if (!use_fog)
{
@@ -4922,7 +4936,9 @@ void LLPipeline::renderDebug()
glClearColor(clearColor.mV[0],clearColor.mV[1],clearColor.mV[2],0);
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
gGL.setColorMask(true, false);
+#if GL_VERSION_1_1
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+#endif
}
//NavMesh
@@ -4952,7 +4968,9 @@ void LLPipeline::renderDebug()
gPathfindingProgram.bind();
gGL.flush();
+#if GL_VERSION_1_1
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+#endif
glLineWidth(1.0f);
gGL.flush();
}
@@ -5009,7 +5027,9 @@ void LLPipeline::renderDebug()
LLGLDisable cull(i >= 2 ? GL_CULL_FACE : 0);
gGL.flush();
+#if GL_VERSION_1_1
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+#endif
//get rid of some z-fighting
LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
@@ -5034,8 +5054,10 @@ void LLPipeline::renderDebug()
gGL.flush();
}
+#if GL_VERSION_1_1
LLGLEnable lineOffset(GL_POLYGON_OFFSET_LINE);
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+#endif
F32 offset = gSavedSettings.getF32("PathfindingLineOffset");
@@ -5055,10 +5077,14 @@ void LLPipeline::renderDebug()
}
else
{
+#if GL_VERSION_1_1
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+#endif
gPathfindingProgram.uniform1f(sAmbiance, ambiance);
llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+#endif
}
}
@@ -5075,7 +5101,9 @@ void LLPipeline::renderDebug()
glLineWidth(1.f);
}
+#if GL_VERSION_1_1
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+#endif
}
}
}
@@ -5086,7 +5114,9 @@ void LLPipeline::renderDebug()
{ //render navmesh xray
F32 ambiance = gSavedSettings.getF32("PathfindingAmbiance");
+#if GL_VERSION_1_1
LLGLEnable lineOffset(GL_POLYGON_OFFSET_LINE);
+#endif
LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
F32 offset = gSavedSettings.getF32("PathfindingLineOffset");
@@ -5103,10 +5133,14 @@ void LLPipeline::renderDebug()
if (gSavedSettings.getBOOL("PathfindingXRayWireframe"))
{ //draw hidden wireframe as darker and less opaque
+#if GL_VERSION_1_1
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+#endif
gPathfindingProgram.uniform1f(sAmbiance, 1.f);
llPathingLibInstance->renderNavMesh();
+#if GL_VERSION_1_1
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+#endif
}
else
{
@@ -5147,7 +5181,9 @@ void LLPipeline::renderDebug()
gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep, true);
+#if GL_VERSION_1_1
glPointSize(8.f);
+#endif
LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS);
gGL.begin(LLRender::POINTS);
@@ -5172,7 +5208,9 @@ void LLPipeline::renderDebug()
}
gGL.end();
gGL.flush();
+#if GL_VERSION_1_1
glPointSize(1.f);
+#endif
}
@@ -5335,7 +5373,9 @@ void LLPipeline::renderDebug()
{
//render visible point cloud
gGL.flush();
+#if GL_VERSION_1_1
glPointSize(8.f);
+#endif
gGL.begin(LLRender::POINTS);
F32* c = col+i*4;
@@ -5349,7 +5389,9 @@ void LLPipeline::renderDebug()
gGL.end();
gGL.flush();
+#if GL_VERSION_1_1
glPointSize(1.f);
+#endif
LLVector3* ext = mShadowExtents[i];
LLVector3 pos = (ext[0]+ext[1])*0.5f;
@@ -7481,7 +7523,9 @@ void LLPipeline::renderFinalize()
if (gUseWireframe)
{
+#if GL_VERSION_1_1
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
}
LLVector2 tc1(0, 0);
@@ -7502,7 +7546,9 @@ void LLPipeline::renderFinalize()
gGL.pushMatrix();
gGL.loadIdentity();
+#if GL_VERSION_1_1
LLGLDisable test(GL_ALPHA_TEST);
+#endif
gGL.setColorMask(true, true);
glClearColor(0, 0, 0, 0);
@@ -7529,7 +7575,9 @@ void LLPipeline::renderFinalize()
{
LLGLEnable blend_on(GL_BLEND);
+#if GL_VERSION_1_1
LLGLEnable test(GL_ALPHA_TEST);
+#endif
gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA);
@@ -8541,7 +8589,9 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget *screen_target)
{
LLGLDepthTest depth(GL_FALSE);
LLGLDisable blend(GL_BLEND);
+#if GL_VERSION_1_1
LLGLDisable test(GL_ALPHA_TEST);
+#endif
// full screen blit
gGL.pushMatrix();
@@ -9961,7 +10011,9 @@ void LLPipeline::generateHighlight(LLCamera& camera)
{
F32 transition = gFrameIntervalSeconds.value()/RenderHighlightFadeTime;
+#if GL_VERSION_1_1
LLGLDisable test(GL_ALPHA_TEST);
+#endif
LLGLDepthTest depth(GL_FALSE);
mHighlight.bindTarget();
disableLights();