summaryrefslogtreecommitdiff
path: root/indra/llrender/llcubemaparray.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-09-20 12:28:45 -0500
committerDave Parks <davep@lindenlab.com>2022-09-20 12:28:45 -0500
commit1eeee12ecb4753cc4b651e18474bb80de45fcede (patch)
tree3a61b841f1d5cb05958a41d526ba9e388bd45ab9 /indra/llrender/llcubemaparray.cpp
parent7a9811ee115b7bb678d1310e0c833dc9ac7139ab (diff)
SL-18190 Don't allocate mips for irradiance maps because they're never generated. Disable OpenGL core profile on Intel by default.
Diffstat (limited to 'indra/llrender/llcubemaparray.cpp')
-rw-r--r--indra/llrender/llcubemaparray.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/indra/llrender/llcubemaparray.cpp b/indra/llrender/llcubemaparray.cpp
index 08ff7c9414..bb4bd58121 100644
--- a/indra/llrender/llcubemaparray.cpp
+++ b/indra/llrender/llcubemaparray.cpp
@@ -107,18 +107,18 @@ LLCubeMapArray::~LLCubeMapArray()
{
}
-void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count)
+void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, BOOL use_mips)
{
U32 texname = 0;
LLImageGL::generateTextures(1, &texname);
- mImage = new LLImageGL(resolution, resolution, components, TRUE);
+ mImage = new LLImageGL(resolution, resolution, components, use_mips);
mImage->setTexName(texname);
mImage->setTarget(sTargets[0], LLTexUnit::TT_CUBE_MAP_ARRAY);
- mImage->setUseMipMaps(TRUE);
- mImage->setHasMipMaps(TRUE);
+ mImage->setUseMipMaps(use_mips);
+ mImage->setHasMipMaps(use_mips);
bind(0);
@@ -127,9 +127,15 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count)
mImage->setAddressMode(LLTexUnit::TAM_CLAMP);
- mImage->setFilteringOption(LLTexUnit::TFO_ANISOTROPIC);
-
- glGenerateMipmap(GL_TEXTURE_CUBE_MAP_ARRAY);
+ if (use_mips)
+ {
+ mImage->setFilteringOption(LLTexUnit::TFO_ANISOTROPIC);
+ glGenerateMipmap(GL_TEXTURE_CUBE_MAP_ARRAY);
+ }
+ else
+ {
+ mImage->setFilteringOption(LLTexUnit::TFO_BILINEAR);
+ }
unbind();
}
@@ -137,7 +143,7 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count)
void LLCubeMapArray::bind(S32 stage)
{
mTextureStage = stage;
- gGL.getTexUnit(stage)->bindManual(LLTexUnit::TT_CUBE_MAP_ARRAY, getGLName(), TRUE);
+ gGL.getTexUnit(stage)->bindManual(LLTexUnit::TT_CUBE_MAP_ARRAY, getGLName(), mImage->getUseMipMaps());
}
void LLCubeMapArray::unbind()