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.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index ee66122774..05a98bff1b 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -81,10 +81,16 @@ static std::unordered_map<U64, LLVBCache> sVBCache;
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
};
@@ -522,17 +528,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.
@@ -547,8 +554,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:
@@ -567,6 +576,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)
@@ -613,7 +623,9 @@ void LLTexUnit::setColorScale(S32 scale)
{
mCurrColorScale = scale;
gGL.flush();
+#if GL_VERSION_1_1
glTexEnvi( GL_TEXTURE_ENV, GL_RGB_SCALE, scale );
+#endif
}
}
@@ -623,7 +635,9 @@ void LLTexUnit::setAlphaScale(S32 scale)
{
mCurrAlphaScale = scale;
gGL.flush();
+#if GL_VERSION_1_1
glTexEnvi( GL_TEXTURE_ENV, GL_ALPHA_SCALE, scale );
+#endif
}
}
@@ -877,7 +891,9 @@ void 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
{ //bind a dummy vertex array object so we're core profile compliant
U32 ret;
@@ -2060,10 +2076,12 @@ void LLRender::diffuseColor3f(F32 r, F32 g, F32 b)
{
shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, r,g,b,1.f);
}
+#if GL_VERSION_1_1
else
{
glColor3f(r,g,b);
}
+#endif
}
void LLRender::diffuseColor3fv(const F32* c)
@@ -2075,10 +2093,12 @@ void LLRender::diffuseColor3fv(const F32* c)
{
shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, c[0], c[1], c[2], 1.f);
}
+#if GL_VERSION_1_1
else
{
glColor3fv(c);
}
+#endif
}
void LLRender::diffuseColor4f(F32 r, F32 g, F32 b, F32 a)
@@ -2090,10 +2110,12 @@ void LLRender::diffuseColor4f(F32 r, F32 g, F32 b, F32 a)
{
shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, r,g,b,a);
}
+#if GL_VERSION_1_1
else
{
glColor4f(r,g,b,a);
}
+#endif
}
void LLRender::diffuseColor4fv(const F32* c)
@@ -2105,10 +2127,12 @@ void LLRender::diffuseColor4fv(const F32* c)
{
shader->uniform4fv(LLShaderMgr::DIFFUSE_COLOR, 1, c);
}
+#if GL_VERSION_1_1
else
{
glColor4fv(c);
}
+#endif
}
void LLRender::diffuseColor4ubv(const U8* c)
@@ -2120,10 +2144,12 @@ void LLRender::diffuseColor4ubv(const U8* c)
{
shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, c[0]/255.f, c[1]/255.f, c[2]/255.f, c[3]/255.f);
}
+#if GL_VERSION_1_1
else
{
glColor4ubv(c);
}
+#endif
}
void LLRender::diffuseColor4ub(U8 r, U8 g, U8 b, U8 a)
@@ -2135,10 +2161,12 @@ void LLRender::diffuseColor4ub(U8 r, U8 g, U8 b, U8 a)
{
shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, r/255.f, g/255.f, b/255.f, a/255.f);
}
+#if GL_VERSION_1_1
else
{
glColor4ub(r,g,b,a);
}
+#endif
}