[Bf-blender-cvs] [741ed16d13b] blender2.8: OpenGL: don't glGet(GL_RED_BITS) in core profile

Mike Erwin noreply at git.blender.org
Thu Apr 27 17:46:40 CEST 2017


Commit: 741ed16d13b3a1ca15390f641369930eda5035a8
Author: Mike Erwin
Date:   Wed Apr 26 18:06:00 2017 -0400
Branches: blender2.8
https://developer.blender.org/rB741ed16d13b3a1ca15390f641369930eda5035a8

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

===================================================================

M	source/blender/gpu/intern/gpu_extensions.c

===================================================================

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);




More information about the Bf-blender-cvs mailing list