diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-04-27 01:06:00 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-04-27 18:43:25 +0300 |
commit | 741ed16d13b3a1ca15390f641369930eda5035a8 (patch) | |
tree | 424c056b508d67d4b7ab571f5cb67cd8ddccaf27 /source/blender/gpu/intern/gpu_extensions.c | |
parent | bfaf7a3eb15e36e69fc00448e6c7fd938a6fa2fa (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.c | 5 |
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); |