summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2023-09-07 21:12:38 +0800
committerErik Kundiman <erik@megapahit.org>2023-09-07 21:12:38 +0800
commitd0b773094d5a3129f5b6db7d9de0da41791b2852 (patch)
tree39f105213ba151355bdb19f54f39a008091be463 /indra
parent3da53b180139d2a79811c1ed7384beaad3a86a48 (diff)
Revert "Bring back GL funcs & macros that work on macOS"
This reverts commit e600f6504cd7edd9d2883ea7dc17c2574b1ff468.
Diffstat (limited to 'indra')
-rw-r--r--indra/llrender/llatmosphere.cpp16
-rw-r--r--indra/llrender/llgl.cpp7
-rw-r--r--indra/llrender/llglslshader.cpp9
-rw-r--r--indra/llrender/llrender.cpp6
-rw-r--r--indra/llrender/llvertexbuffer.cpp49
5 files changed, 20 insertions, 67 deletions
diff --git a/indra/llrender/llatmosphere.cpp b/indra/llrender/llatmosphere.cpp
index 941ffe2711..8e37ca9b90 100644
--- a/indra/llrender/llatmosphere.cpp
+++ b/indra/llrender/llatmosphere.cpp
@@ -241,11 +241,7 @@ LLGLTexture* LLAtmosphere::getTransmittance()
m_transmittance->generateGLTexture();
m_transmittance->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP);
m_transmittance->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR);
-#if GL_ARB_texture_float
- m_transmittance->setExplicitFormat(GL_RGB32F_ARB, GL_RGB, GL_FLOAT);
-#else
m_transmittance->setExplicitFormat(GL_RGB32F, GL_RGB, GL_FLOAT);
-#endif
m_transmittance->setTarget(GL_TEXTURE_2D, LLTexUnit::TT_TEXTURE);
}
return m_transmittance;
@@ -259,11 +255,7 @@ LLGLTexture* LLAtmosphere::getScattering()
m_scattering->generateGLTexture();
m_scattering->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP);
m_scattering->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR);
-#if GL_ARB_texture_float
- m_scattering->setExplicitFormat(GL_RGB16F_ARB, GL_RGB, GL_FLOAT);
-#else
m_scattering->setExplicitFormat(GL_RGB16F, GL_RGB, GL_FLOAT);
-#endif
m_scattering->setTarget(GL_TEXTURE_3D, LLTexUnit::TT_TEXTURE_3D);
}
return m_scattering;
@@ -277,11 +269,7 @@ LLGLTexture* LLAtmosphere::getMieScattering()
m_mie_scatter_texture->generateGLTexture();
m_mie_scatter_texture->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP);
m_mie_scatter_texture->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR);
-#if GL_ARB_texture_float
- m_mie_scatter_texture->setExplicitFormat(GL_RGB16F_ARB, GL_RGB, GL_FLOAT);
-#else
m_mie_scatter_texture->setExplicitFormat(GL_RGB16F, GL_RGB, GL_FLOAT);
-#endif
m_mie_scatter_texture->setTarget(GL_TEXTURE_3D, LLTexUnit::TT_TEXTURE_3D);
}
return m_mie_scatter_texture;
@@ -295,11 +283,7 @@ LLGLTexture* LLAtmosphere::getIlluminance()
m_illuminance->generateGLTexture();
m_illuminance->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP);
m_illuminance->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR);
-#if GL_ARB_texture_float
- m_illuminance->setExplicitFormat(GL_RGB32F_ARB, GL_RGB, GL_FLOAT);
-#else
m_illuminance->setExplicitFormat(GL_RGB32F, GL_RGB, GL_FLOAT);
-#endif
m_illuminance->setTarget(GL_TEXTURE_2D, LLTexUnit::TT_TEXTURE);
}
return m_illuminance;
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 9c809d5bd0..f597b1a932 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -777,12 +777,10 @@ bool LLGLManager::initGL()
if (mHasTextureMultisample)
{
-#if GL_VERSION_3_2
glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &mMaxColorTextureSamples);
glGetIntegerv(GL_MAX_DEPTH_TEXTURE_SAMPLES, &mMaxDepthTextureSamples);
glGetIntegerv(GL_MAX_INTEGER_SAMPLES, &mMaxIntegerSamples);
glGetIntegerv(GL_MAX_SAMPLE_MASK_WORDS, &mMaxSampleMaskWords);
-#endif
}
stop_glerror();
@@ -1623,13 +1621,8 @@ void LLGLState::initClass()
// sStateMap[GL_TEXTURE_2D] = GL_TRUE;
//make sure multisample defaults to disabled
-#if GL_ARB_multisample
- sStateMap[GL_MULTISAMPLE_ARB] = GL_FALSE;
- glDisable(GL_MULTISAMPLE_ARB);
-#elif GL_EXT_multisample || GL_EXT_multisample_compatibility
sStateMap[GL_MULTISAMPLE_EXT] = GL_FALSE;
glDisable(GL_MULTISAMPLE_EXT);
-#endif
}
//static
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index f587fb414c..58a9e28270 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -797,21 +797,16 @@ GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER;
-#if GL_VERSION_2_0 || GL_VERSION_3_2
if (
#if GL_VERSION_2_0
- (type >= GL_SAMPLER_1D_ARB && type <= GL_SAMPLER_2D_RECT_SHADOW_ARB)
+ (type >= GL_SAMPLER_1D_ARB && type <= GL_SAMPLER_2D_RECT_SHADOW_ARB) ||
#endif
-#if GL_VERSION_3_2
- || type == GL_SAMPLER_2D_MULTISAMPLE
-#endif
- )
+ type == GL_SAMPLER_2D_MULTISAMPLE)
{ //this here is a texture
glUniform1i(location, mActiveTextureChannels);
LL_DEBUGS("ShaderUniform") << "Assigned to texture channel " << mActiveTextureChannels << LL_ENDL;
return mActiveTextureChannels++;
}
-#endif // GL_VERSION_2_0 || GL_VERSION_3_2
return -1;
}
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 91ce983e5a..89de6b93ea 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -906,13 +906,9 @@ void LLRender::init(bool needs_vertex_buffer)
{ //bind a dummy vertex array object so we're core profile compliant
//#ifdef GL_ARB_vertex_array_object
U32 ret;
-#if GL_APPLE_vertex_array_object
- glGenVertexArraysAPPLE(1, &ret);
- glBindVertexArrayAPPLE(ret);
-#else
glGenVertexArrays(1, &ret);
glBindVertexArray(ret);
-#endif
+//#endif
}
if (needs_vertex_buffer)
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 0c8a8fed6a..f71403d2f4 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -404,11 +404,8 @@ U32 LLVertexBuffer::getVAOName()
else
{
//#ifdef GL_ARB_vertex_array_object
-#if GL_APPLE_vertex_array_object
- glGenVertexArraysAPPLE(1, &ret);
-#else
glGenVertexArrays(1, &ret);
-#endif
+//#endif
}
return ret;
@@ -761,11 +758,8 @@ void LLVertexBuffer::unbind()
if (sGLRenderArray)
{
//#if GL_ARB_vertex_array_object
-#if GL_APPLE_vertex_array_object
- glBindVertexArrayAPPLE(0);
-#else
glBindVertexArray(0);
-#endif
+//#endif
sGLRenderArray = 0;
sGLRenderIndices = 0;
sIBOActive = false;
@@ -1265,11 +1259,8 @@ void LLVertexBuffer::setupVertexArray()
LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX;
//#if GL_ARB_vertex_array_object
-#if GL_APPLE_vertex_array_object
- glBindVertexArrayAPPLE(mGLArray);
-#else
glBindVertexArray(mGLArray);
-#endif
+//#endif
sGLRenderArray = mGLArray;
static const U32 attrib_size[] =
@@ -1543,10 +1534,12 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran
{
if (map_range)
{
-#if !LL_MESA_HEADLESS && GL_APPLE_flush_buffer_range && LL_DARWIN
+/*
+#ifndef LL_MESA_HEADLESS
glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE);
glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE);
#endif
+*/
src = (U8*) glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
}
else
@@ -1716,10 +1709,12 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
{
if (map_range)
{
-#if !LL_MESA_HEADLESS && GL_APPLE_flush_buffer_range && LL_DARWIN
+/*
+#ifndef LL_MESA_HEADLESS
glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE);
glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE);
#endif
+*/
src = (U8*) glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY);
}
else
@@ -1845,17 +1840,13 @@ void LLVertexBuffer::unmapBuffer()
S32 length = sTypeSize[region.mType]*region.mCount;
if (gGLManager.mHasMapBufferRange)
{
-#if GL_APPLE_flush_buffer_range && LL_DARWIN
- glFlushMappedBufferRangeAPPLE(GL_ARRAY_BUFFER, offset, length);
-#elif GL_ARB_map_buffer_range || GL_EXT_map_buffer_range
+#if GL_ARB_map_buffer_range || GL_EXT_map_buffer_range
glFlushMappedBufferRange(GL_ARRAY_BUFFER, offset, length);
#endif
}
else if (gGLManager.mHasFlushBufferRange)
{
-#if !LL_MESA_HEADLESS && GL_APPLE_flush_buffer_range && LL_DARWIN
- glFlushMappedBufferRangeAPPLE(GL_ARRAY_BUFFER, offset, length);
-#else
+#ifndef LL_MESA_HEADLESS
glFlushMappedBufferRange(GL_ARRAY_BUFFER, offset, length);
#endif
}
@@ -1929,20 +1920,20 @@ void LLVertexBuffer::unmapBuffer()
S32 length = sizeof(U16)*region.mCount;
if (gGLManager.mHasMapBufferRange)
{
-#if GL_APPLE_flush_buffer_range && LL_DARWIN
- glFlushMappedBufferRangeAPPLE(GL_ELEMENT_ARRAY_BUFFER, offset, length);
-#elif GL_ARB_map_buffer_range || GL_EXT_map_buffer_range
+#if GL_ARB_map_buffer_range || GL_EXT_map_buffer_range
glFlushMappedBufferRange(GL_ELEMENT_ARRAY_BUFFER, offset, length);
#endif
}
+ /*
else if (gGLManager.mHasFlushBufferRange)
{
-#if GL_APPLE_flush_buffer_range && LL_DARWIN
+#ifdef GL_APPLE_flush_buffer_range
#ifndef LL_MESA_HEADLESS
glFlushMappedBufferRangeAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length);
#endif
#endif
}
+ */
stop_glerror();
}
@@ -2080,11 +2071,8 @@ bool LLVertexBuffer::bindGLArray()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX;
//#if GL_ARB_vertex_array_object
-#if GL_APPLE_vertex_array_object
- glBindVertexArrayAPPLE(mGLArray);
-#else
glBindVertexArray(mGLArray);
-#endif
+//#endif
sGLRenderArray = mGLArray;
}
@@ -2313,11 +2301,8 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
if (sGLRenderArray)
{
//#if GL_ARB_vertex_array_object
-#if GL_APPLE_vertex_array_object
- glBindVertexArrayAPPLE(0);
-#else
glBindVertexArray(0);
-#endif
+//#endif
sGLRenderArray = 0;
sGLRenderIndices = 0;
sIBOActive = false;