Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2017-04-27 01:06:00 +0300
committerMike Erwin <significant.bit@gmail.com>2017-04-27 18:43:25 +0300
commit741ed16d13b3a1ca15390f641369930eda5035a8 (patch)
tree424c056b508d67d4b7ab571f5cb67cd8ddccaf27 /source/blender/gpu/intern/gpu_extensions.c
parentbfaf7a3eb15e36e69fc00448e6c7fd938a6fa2fa (diff)
OpenGL: don't glGet(GL_RED_BITS) in core profile
or GREEN or BLUE. These are deprecated and cause errors under core profile. TODO: get color depth value another way Part of T51164
Diffstat (limited to 'source/blender/gpu/intern/gpu_extensions.c')
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index a1df861d699..53a683752ce 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -168,11 +168,16 @@ void gpu_extensions_init(void)
glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &GG.maxubobinds);
glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &GG.maxubosize);
+#ifdef WITH_LEGACY_OPENGL
GLint r, g, b;
glGetIntegerv(GL_RED_BITS, &r);
glGetIntegerv(GL_GREEN_BITS, &g);
glGetIntegerv(GL_BLUE_BITS, &b);
GG.colordepth = r + g + b; /* assumes same depth for RGB */
+#else
+ GG.colordepth = 24; /* cheat. */
+ /* TODO: get this value another way */
+#endif
if (GLEW_VERSION_3_2 || GLEW_ARB_texture_multisample) {
glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &GG.samples_color_texture_max);