summaryrefslogtreecommitdiff
path: root/indra/llrender/llrender.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender/llrender.cpp')
-rw-r--r--indra/llrender/llrender.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index eb2cd560a6..d333a3fd54 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -83,10 +83,16 @@ static thread_local std::list<LLVertexBufferData> *sBufferDataList = nullptr;
static const GLenum sGLTextureType[] =
{
GL_TEXTURE_2D,
+#if GL_VERSION_3_1
GL_TEXTURE_RECTANGLE,
+#endif
GL_TEXTURE_CUBE_MAP,
+#if GL_VERSION_4_0
GL_TEXTURE_CUBE_MAP_ARRAY,
+#endif
+#if GL_VERSION_3_2
GL_TEXTURE_2D_MULTISAMPLE,
+#endif
GL_TEXTURE_3D
};
@@ -514,17 +520,18 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio
{
if (LLImageGL::sGlobalUseAnisotropic && option == TFO_ANISOTROPIC)
{
- glTexParameterf(sGLTextureType[mCurrTexType], GL_TEXTURE_MAX_ANISOTROPY, gGLManager.mMaxAnisotropy);
+ glTexParameterf(sGLTextureType[mCurrTexType], GL_TEXTURE_MAX_ANISOTROPY_EXT, gGLManager.mMaxAnisotropy);
}
else
{
- glTexParameterf(sGLTextureType[mCurrTexType], GL_TEXTURE_MAX_ANISOTROPY, 1.f);
+ glTexParameterf(sGLTextureType[mCurrTexType], GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.f);
}
}
}
GLint LLTexUnit::getTextureSource(eTextureBlendSrc src)
{
+#if GL_VERSION_1_3
switch(src)
{
// All four cases should return the same value.
@@ -539,8 +546,10 @@ GLint LLTexUnit::getTextureSource(eTextureBlendSrc src)
case TBS_TEX_ALPHA:
case TBS_ONE_MINUS_TEX_COLOR:
case TBS_ONE_MINUS_TEX_ALPHA:
+#endif
return GL_TEXTURE;
+#if GL_VERSION_1_3
// All four cases should return the same value.
case TBS_VERT_COLOR:
case TBS_VERT_ALPHA:
@@ -559,6 +568,7 @@ GLint LLTexUnit::getTextureSource(eTextureBlendSrc src)
LL_WARNS() << "Unknown eTextureBlendSrc: " << src << ". Using Vertex Color instead." << LL_ENDL;
return GL_PRIMARY_COLOR;
}
+#endif
}
GLint LLTexUnit::getTextureSourceType(eTextureBlendSrc src, bool isAlpha)
@@ -605,7 +615,9 @@ void LLTexUnit::setColorScale(S32 scale)
{
mCurrColorScale = scale;
gGL.flush();
+#if GL_VERSION_1_1
glTexEnvi( GL_TEXTURE_ENV, GL_RGB_SCALE, scale );
+#endif
}
}
@@ -615,7 +627,9 @@ void LLTexUnit::setAlphaScale(S32 scale)
{
mCurrAlphaScale = scale;
gGL.flush();
+#if GL_VERSION_1_1
glTexEnvi( GL_TEXTURE_ENV, GL_ALPHA_SCALE, scale );
+#endif
}
}
@@ -867,7 +881,9 @@ bool LLRender::init(bool needs_vertex_buffer)
glCullFace(GL_BACK);
// necessary for reflection maps
+#if GL_VERSION_3_2
glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
+#endif
#if LL_WINDOWS
if (glGenVertexArrays == nullptr)
@@ -2016,9 +2032,11 @@ void LLRender::debugTexUnits(void)
case LLTexUnit::TT_TEXTURE:
LL_CONT << "Texture 2D";
break;
+#if GL_VERSION_3_1
case LLTexUnit::TT_RECT_TEXTURE:
LL_CONT << "Texture Rectangle";
break;
+#endif
case LLTexUnit::TT_CUBE_MAP:
LL_CONT << "Cube Map";
break;