From 3b19aa7991021939b9cca61911acb40f391a86d0 Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Sun, 20 Apr 2014 17:20:50 +0200 Subject: [PATCH] Added glConfig.vendorType settings for Linux and disabled unused shaders. #90 --- neo/renderer/RenderProgs.cpp | 6 +++--- neo/renderer/RenderSystem_init.cpp | 9 +++++++++ neo/sys/sdl/sdl_glimp.cpp | 6 ++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/neo/renderer/RenderProgs.cpp b/neo/renderer/RenderProgs.cpp index aaa68188..f11e0eb8 100644 --- a/neo/renderer/RenderProgs.cpp +++ b/neo/renderer/RenderProgs.cpp @@ -90,7 +90,7 @@ void idRenderProgManager::Init() { { BUILTIN_GUI, "gui.vfp", false }, { BUILTIN_COLOR, "color.vfp", false }, - { BUILTIN_SIMPLESHADE, "simpleshade.vfp", false }, +// { BUILTIN_SIMPLESHADE, "simpleshade.vfp", false }, { BUILTIN_TEXTURED, "texture.vfp", false }, { BUILTIN_TEXTURE_VERTEXCOLOR, "texture_color.vfp", false }, { BUILTIN_TEXTURE_VERTEXCOLOR_SKINNED, "texture_color_skinned.vfp", true }, @@ -117,11 +117,11 @@ void idRenderProgManager::Init() { BUILTIN_POSTPROCESS, "postprocess.vfp", false }, { BUILTIN_STEREO_DEGHOST, "stereoDeGhost.vfp", false }, { BUILTIN_STEREO_WARP, "stereoWarp.vfp", false }, - { BUILTIN_ZCULL_RECONSTRUCT, "zcullReconstruct.vfp", false }, +// { BUILTIN_ZCULL_RECONSTRUCT, "zcullReconstruct.vfp", false }, { BUILTIN_BINK, "bink.vfp", false }, { BUILTIN_BINK_GUI, "bink_gui.vfp", false }, { BUILTIN_STEREO_INTERLACE, "stereoInterlace.vfp", false }, - { BUILTIN_MOTION_BLUR, "motionBlur.vfp", false }, +// { BUILTIN_MOTION_BLUR, "motionBlur.vfp", false }, { BUILTIN_SHADOW, "shadow.vfp", false }, { BUILTIN_SHADOW_SKINNED, "shadow_skinned.vfp", true }, }; diff --git a/neo/renderer/RenderSystem_init.cpp b/neo/renderer/RenderSystem_init.cpp index 8ba996dc..36722888 100644 --- a/neo/renderer/RenderSystem_init.cpp +++ b/neo/renderer/RenderSystem_init.cpp @@ -401,6 +401,15 @@ static void R_CheckPortableExtensions() glConfig.vendor = VENDOR_INTEL; } + // RB: HACK for testing: Mesa support +#if defined(__linux__) //!defined(_WIN32) && !defined(__ANDROID__) + //if( glConfig.vendor == VENDOR_INTEL ) + { + glConfig.driverType = GLDRV_OPENGL_MESA; + } +#endif + // RB end + // GL_ARB_multitexture glConfig.multitextureAvailable = R_CheckExtension( "GL_ARB_multitexture" ); if( glConfig.multitextureAvailable ) diff --git a/neo/sys/sdl/sdl_glimp.cpp b/neo/sys/sdl/sdl_glimp.cpp index 7002c22c..80f4b745 100644 --- a/neo/sys/sdl/sdl_glimp.cpp +++ b/neo/sys/sdl/sdl_glimp.cpp @@ -194,6 +194,8 @@ bool GLimp_Init( glimpParms_t parms ) // RB begin if( r_useOpenGL32.GetInteger() > 0 ) { + glConfig.driverType = GLDRV_OPENGL32_COMPATIBILITY_PROFILE; + SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, 3 ); SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION, 2 ); @@ -205,6 +207,8 @@ bool GLimp_Init( glimpParms_t parms ) if( r_useOpenGL32.GetInteger() > 1 ) { + glConfig.driverType = GLDRV_OPENGL32_CORE_PROFILE; + SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE ); } // RB end @@ -255,6 +259,8 @@ bool GLimp_Init( glimpParms_t parms ) glConfig.isFullscreen = ( SDL_GetWindowFlags( window ) & SDL_WINDOW_FULLSCREEN ) == SDL_WINDOW_FULLSCREEN; #else + glConfig.driverType = GLDRV_OPENGL3X; + SDL_WM_SetCaption( GAME_NAME, GAME_NAME ); if( SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, r_swapInterval.GetInteger() ) < 0 )