summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2023-09-06 11:12:42 +0800
committerErik Kundiman <erik@megapahit.org>2023-09-06 11:12:42 +0800
commit623456626ffbb08dff208cf35dd3ac5df6755a37 (patch)
tree90109bb49cabae2dcd49033a11c0a73d0fabd817
parent4daff432fcc2272b8d32bd78d3ae47780cc3edca (diff)
Always compile vertex array code
So that, especially modern, GL implementations that do have vertex array but don't have the legacy GL_ARB_vertex_array_object defined have such code compiled too.
-rw-r--r--indra/llrender/llrender.cpp4
-rw-r--r--indra/llrender/llvertexbuffer.cpp28
2 files changed, 16 insertions, 16 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index eb1c7dcee9..f34161980a 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -902,11 +902,11 @@ void LLRender::init(bool needs_vertex_buffer)
if (sGLCoreProfile && !LLVertexBuffer::sUseVAO)
{ //bind a dummy vertex array object so we're core profile compliant
-#ifdef GL_ARB_vertex_array_object
+//#ifdef GL_ARB_vertex_array_object
U32 ret;
glGenVertexArrays(1, &ret);
glBindVertexArray(ret);
-#endif
+//#endif
}
if (needs_vertex_buffer)
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 1893764cab..6cc6078ec8 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -403,9 +403,9 @@ U32 LLVertexBuffer::getVAOName()
}
else
{
-#ifdef GL_ARB_vertex_array_object
+//#ifdef GL_ARB_vertex_array_object
glGenVertexArrays(1, &ret);
-#endif
+//#endif
}
return ret;
@@ -757,9 +757,9 @@ void LLVertexBuffer::unbind()
{
if (sGLRenderArray)
{
-#if GL_ARB_vertex_array_object
+//#if GL_ARB_vertex_array_object
glBindVertexArray(0);
-#endif
+//#endif
sGLRenderArray = 0;
sGLRenderIndices = 0;
sIBOActive = false;
@@ -927,9 +927,9 @@ LLVertexBuffer::~LLVertexBuffer()
if (mGLArray)
{
-#if GL_ARB_vertex_array_object
+//#if GL_ARB_vertex_array_object
releaseVAOName(mGLArray);
-#endif
+//#endif
}
sCount--;
@@ -1240,9 +1240,9 @@ bool LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
if (gGLManager.mHasVertexArrayObject && useVBOs() && sUseVAO)
{
-#if GL_ARB_vertex_array_object
+//#if GL_ARB_vertex_array_object
mGLArray = getVAOName();
-#endif
+//#endif
setupVertexArray();
}
}
@@ -1258,9 +1258,9 @@ void LLVertexBuffer::setupVertexArray()
}
LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX;
-#if GL_ARB_vertex_array_object
+//#if GL_ARB_vertex_array_object
glBindVertexArray(mGLArray);
-#endif
+//#endif
sGLRenderArray = mGLArray;
static const U32 attrib_size[] =
@@ -2064,9 +2064,9 @@ bool LLVertexBuffer::bindGLArray()
{
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX;
-#if GL_ARB_vertex_array_object
+//#if GL_ARB_vertex_array_object
glBindVertexArray(mGLArray);
-#endif
+//#endif
sGLRenderArray = mGLArray;
}
@@ -2294,9 +2294,9 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
{
if (sGLRenderArray)
{
-#if GL_ARB_vertex_array_object
+//#if GL_ARB_vertex_array_object
glBindVertexArray(0);
-#endif
+//#endif
sGLRenderArray = 0;
sGLRenderIndices = 0;
sIBOActive = false;