From: Brian P. <br...@va...> - 2000-10-05 14:17:04
|
Klaus Niederkrueger wrote: > > bash$ LD_PRELOAD=~/Mesa/src/.libs/libGL.so.1.2.030500 ./walktest funky -video=opengl > Using alternative 3D driver: crystalspace.graphics3d.opengl > Crystal Space version 0.17 r001 [Linux-Intel-GCC] (Wed, 1-Sep-2000). > Created by Jorrit Tyberghein and others... > > Video driver GL/X version (direct renderer) > Visual ID: 20, 16bit TrueColor > Frame buffer: 16bit R5:G6:B5:A0, level 0, double buffered, > Depth buffer: 8bit <<<------ > OpenGL renderer: Mesa X11 version 1.2 Mesa 3.5 beta > Using windowed mode at resolution 640x480. > Loading world '/lev/funky'... > > It's 8bit, while with Mesa-3.2 it is 16bit. I grabbed the Crystal Space sources and grep'd for glXChooseVisual. In plugins/video/canvas/openglx/glx2d.cpp in the csGraphics2DGLX::Open() function I see this: int desired_attributes[] = { GLX_RGBA, GLX_DEPTH_SIZE, 8, GLX_RED_SIZE, 4, GLX_BLUE_SIZE, 4, GLX_GREEN_SIZE, 4, None, None }; The GLX spec says that this should choose a visual with the deepest depth buffer of at least 8 bits. While this is perfectly legal, Mesa has a problem with this. Mesa's GLX, as we all know, is not real a GLX but an emulation and it can't do everything right. When Mesa sees GLX_DEPTH_SIZE=0, it doesn't allocate a depth buffer. If GLX_DEPTH_SIZE=1, it allocates a 16-bit depth buffer (the default depth buffer size). Otherwise, if GLX_DEPTH_SIZE=N and N>1, then Mesa allocates an N-bit depth buffer. This allows one to get a deeper depth buffer (such as 24-bits) if needed. I didn't think anyone would ever request a depth of 1 to 15 bits so the code is kind of dumb when that happens. There's two possible solutions: 1. Modify Crystal Space to specify GLX_DEPTH_SIZE=1 or GLX_DEPTH_SIZE=16. 2. Modify Mesa so that a 16-bit (the default) depth buffer is chosen if GLX_DEPTH_SIZE is between 1 and 16. Any comments? Is anyone on this list also involved in the Crystal Space project? -Brian |