From 64c89ee2c51c539d38d4d55807b18172d6606514 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 13 Feb 2012 15:41:21 -0600 Subject: SH-2908 Fix for mac build --- indra/llrender/llgl.cpp | 9 +++++++++ indra/llrender/llvertexbuffer.cpp | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index e855dda57d..197bc2b422 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -561,6 +561,15 @@ bool LLGLManager::initGL() if (mGLVersion >= 2.f) { parse_glsl_version(mGLSLVersionMajor, mGLSLVersionMinor); + +#if LL_DARWIN + //never use GLSL greater than 1.20 on OSX + if (mGLSLVersionMajor > 1 || mGLSLVersionMinor >= 30) + { + mGLSLVersionMajor = 1; + mGLSLVersionMinor = 20; + } +#endif } // Trailing space necessary to keep "nVidia Corpor_ati_on" cards diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index b2438ef824..a7f0170658 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1264,11 +1264,13 @@ void LLVertexBuffer::setupVertexArray() if (attrib_integer) { +#if !LL_DARWIN //glVertexattribIPointer requires GLSL 1.30 or later if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30) { glVertexAttribIPointer(i, attrib_size[i], attrib_type[i], sTypeSize[i], (void*) mOffsets[i]); } +#endif } else { @@ -2258,9 +2260,11 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) if (data_mask & MAP_TEXTURE_INDEX && (gGLManager.mGLSLVersionMajor >= 2 || gGLManager.mGLSLVersionMinor >= 30)) //indexed texture rendering requires GLSL 1.30 or later { +#if !LL_DARWIN S32 loc = TYPE_TEXTURE_INDEX; void *ptr = (void*) (base + mOffsets[TYPE_VERTEX] + 12); glVertexAttribIPointer(loc, 4, GL_UNSIGNED_BYTE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr); +#endif } if (data_mask & MAP_VERTEX) { -- cgit v1.2.3