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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-07-04 16:24:19 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-07-04 16:24:19 +0400
commit90162cb0cb4ad432a7453c7d5ec7de832a058f16 (patch)
treea83e17623392d53b40604e64fb779975aa3d5107 /source/blender/gpu/intern
parentace570cb1024f0b3affd48b2f2104af3048d1707 (diff)
Fix #21894: backface selection wasn't working correct with < 24 bits colors,
e.g. thousands of colors on OS X, due to use of uninitialized value. Problem tracked down and patch provided by Shane Ambler, thanks!
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 4eaf969ee8a..0b7ea605ec8 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -71,7 +71,7 @@ static struct GPUGlobal {
GLuint currentfb;
int glslsupport;
int extdisabled;
- int color24bit;
+ int colordepth;
GPUDeviceType device;
GPUOSType os;
GPUDriverType driver;
@@ -93,7 +93,7 @@ void GPU_extensions_disable()
void GPU_extensions_init()
{
- GLint bits;
+ GLint r, g, b;
const char *vendor, *renderer;
glewInit();
@@ -108,9 +108,11 @@ void GPU_extensions_init()
if (!GLEW_ARB_vertex_shader) GG.glslsupport = 0;
if (!GLEW_ARB_fragment_shader) GG.glslsupport = 0;
- glGetIntegerv(GL_RED_BITS, &bits);
- GG.color24bit = (bits >= 8);
-
+ 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 */
+
vendor = (const char*)glGetString(GL_VENDOR);
renderer = (const char*)glGetString(GL_RENDERER);
@@ -178,9 +180,9 @@ int GPU_non_power_of_two_support()
return GLEW_ARB_texture_non_power_of_two;
}
-int GPU_24bit_color_support()
+int GPU_color_depth()
{
- return GG.color24bit;
+ return GG.colordepth;
}
int GPU_print_error(char *str)