summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2023-09-11 13:32:41 +0800
committerErik Kundiman <erik@megapahit.org>2023-09-11 13:32:41 +0800
commitaf2a0ae3bc3674fe20bc9eac8f3c9449e329372f (patch)
treee30f90ab1e1d4adf3e19df72e7f29e0b3e2ce193
parent4f45656ca98a144155cb492ca30c92d051d47e4c (diff)
Preprocess non portable OpenGL 4.0 code
-rw-r--r--indra/llrender/llcubemaparray.cpp2
-rw-r--r--indra/llrender/llrender.cpp2
-rw-r--r--indra/newview/llreflectionmapmanager.cpp6
3 files changed, 10 insertions, 0 deletions
diff --git a/indra/llrender/llcubemaparray.cpp b/indra/llrender/llcubemaparray.cpp
index 7d3a92237b..74c2161aa7 100644
--- a/indra/llrender/llcubemaparray.cpp
+++ b/indra/llrender/llcubemaparray.cpp
@@ -128,8 +128,10 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, BOOL us
while (resolution >= 1)
{
+#if GL_VERSION_4_0
glTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, mip, format, resolution, resolution, count * 6, 0,
GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
+#endif
if (!use_mips)
{
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 6356c04c6e..c4a1c2f5d2 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -85,7 +85,9 @@ static const GLenum sGLTextureType[] =
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
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp
index bb0bb04797..5cf9608bb1 100644
--- a/indra/newview/llreflectionmapmanager.cpp
+++ b/indra/newview/llreflectionmapmanager.cpp
@@ -681,7 +681,9 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face)
LL_PROFILE_GPU_ZONE("probe mip copy");
mTexture->bind(0);
//glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, mip, 0, 0, probe->mCubeIndex * 6 + face, 0, 0, res, res);
+#if GL_VERSION_4_0
glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, mip, 0, 0, sourceIdx * 6 + face, 0, 0, res, res);
+#endif
//if (i == 0)
//{
//glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, mip, 0, 0, probe->mCubeIndex * 6 + face, 0, 0, res, res);
@@ -739,7 +741,9 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face)
mVertexBuffer->drawArrays(gGL.TRIANGLE_STRIP, 0, 4);
+#if GL_VERSION_4_0
glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, i, 0, 0, probe->mCubeIndex * 6 + cf, 0, 0, res, res);
+#endif
}
if (i != mMipChain.size() - 1)
@@ -790,7 +794,9 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face)
S32 res = mMipChain[i].getWidth();
mIrradianceMaps->bind(channel);
+#if GL_VERSION_4_0
glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, i - start_mip, 0, 0, probe->mCubeIndex * 6 + cf, 0, 0, res, res);
+#endif
mTexture->bind(channel);
}
}