Skip to content

Commit 2b6d388

Browse files
committed
NUKE depth/stencil channels of default framebuffer
All 3D rendering and even screen-space effects are done in FBOs. The default framebuffer is only targeted when drawing the UI, so a depth buffer is not neede.
1 parent 62d37a7 commit 2b6d388

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/engine/sys/sdl_glimp.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,11 +755,16 @@ static std::string ContextDescription( const glConfiguration& configuration )
755755

756756
static void GLimp_SetAttributes( const glConfiguration &configuration )
757757
{
758+
// FIXME: 3 * 4 = 12 which is more than 8
758759
int perChannelColorBits = configuration.colorBits == 24 ? 8 : 4;
759760

760761
SDL_GL_SetAttribute( SDL_GL_RED_SIZE, perChannelColorBits );
761762
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, perChannelColorBits );
762763
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, perChannelColorBits );
764+
765+
// Depth/stencil channels are not needed since all 3D rendering is done in FBOs
766+
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 0 );
767+
SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 0 );
763768
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
764769

765770
if ( !r_glAllowSoftware->integer )

0 commit comments

Comments
 (0)