summaryrefslogtreecommitdiff
path: root/indra/llrender/llglslshader.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2023-09-05 23:14:03 +0800
committerErik Kundiman <erik@megapahit.org>2023-09-05 23:14:03 +0800
commited44bcf9f763a7d1f7549eb1f03d8aa7fb933ef7 (patch)
tree0d37e52d48fd72f61ce4f6ac718a494c8b45c5a7 /indra/llrender/llglslshader.cpp
parent6e9102ad408282ea6d5f8926f4a6ed377fe922ef (diff)
Preprocess non portable GL funcs & macros
so that implementations that don't include a certain GL implementation won't fail trying to compile the code.
Diffstat (limited to 'indra/llrender/llglslshader.cpp')
-rw-r--r--indra/llrender/llglslshader.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index da24d999b0..cfc871e0c6 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -677,10 +677,14 @@ void LLGLSLShader::mapUniform(GLint index, const vector<LLStaticHashedString> *
case GL_FLOAT_VEC2: size *= 2; break;
case GL_FLOAT_VEC3: size *= 3; break;
case GL_FLOAT_VEC4: size *= 4; break;
+#if GL_VERSION_1_1
case GL_DOUBLE: size *= 2; break;
+#if GL_VERSION_4_0
case GL_DOUBLE_VEC2: size *= 2; break;
case GL_DOUBLE_VEC3: size *= 6; break;
case GL_DOUBLE_VEC4: size *= 8; break;
+#endif // GL_VERSION_4_0
+#endif // GL_VERSION_1_1
case GL_INT_VEC2: size *= 2; break;
case GL_INT_VEC3: size *= 3; break;
case GL_INT_VEC4: size *= 4; break;
@@ -699,6 +703,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector<LLStaticHashedString> *
case GL_FLOAT_MAT3x4: size *= 12; break;
case GL_FLOAT_MAT4x2: size *= 8; break;
case GL_FLOAT_MAT4x3: size *= 12; break;
+#if GL_VERSION_4_0
case GL_DOUBLE_MAT2: size *= 8; break;
case GL_DOUBLE_MAT3: size *= 18; break;
case GL_DOUBLE_MAT4: size *= 32; break;
@@ -708,6 +713,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector<LLStaticHashedString> *
case GL_DOUBLE_MAT3x4: size *= 24; break;
case GL_DOUBLE_MAT4x2: size *= 16; break;
case GL_DOUBLE_MAT4x3: size *= 24; break;
+#endif // GL_VERSION_4_0
}
mTotalUniformSize += size;
}