Changed: Workaround for white/black textures on Intel GPU (issue #310)

--HG--
branch : develop
This commit is contained in:
Nimetu 2017-03-01 20:36:25 +02:00
parent 9bc910d102
commit 5c56eb400e
3 changed files with 26 additions and 0 deletions

View file

@ -30,6 +30,14 @@ ELSE()
SET(NLDRV_OGL_LIB "nel_drv_opengl") SET(NLDRV_OGL_LIB "nel_drv_opengl")
ENDIF() ENDIF()
# This helps to debug issue 310
IF(DEBUG_OGL_SPECULAR_FALLBACK)
ADD_DEFINITIONS(-DDEBUG_OGL_SPECULAR_FALLBACK)
ENDIF()
IF(DEBUG_OGL_COMBINE43_DISABLE)
ADD_DEFINITIONS(-DDEBUG_OGL_COMBINE43_DISABLE)
ENDIF()
NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC}) NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC})
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})

View file

@ -786,7 +786,13 @@ static bool setupNVTextureEnvCombine4(const char *glext)
{ {
H_AUTO_OGL(setupNVTextureEnvCombine4); H_AUTO_OGL(setupNVTextureEnvCombine4);
CHECK_EXT("GL_NV_texture_env_combine4"); CHECK_EXT("GL_NV_texture_env_combine4");
#ifdef DEBUG_OGL_COMBINE43_DISABLE
// issue 310: disable extension to debug bug around CDriverGL::setupSpecularPass()
nlwarning("GL_NV_texture_env_combine4 disabled by request (DEBUG_OGL_COMBINE43_DISABLE)");
return false;
#else
return true; return true;
#endif
} }
// ********************************* // *********************************
@ -802,7 +808,13 @@ static bool setupATITextureEnvCombine3(const char *glext)
// #endif // #endif
CHECK_EXT("GL_ATI_texture_env_combine3"); CHECK_EXT("GL_ATI_texture_env_combine3");
#ifdef DEBUG_OGL_COMBINE43_DISABLE
// issue 310: disable extension to debug bug around CDriverGL::setupSpecularPass()
nlwarning("GL_ATI_texture_env_combine3 disabled by request (DEBUG_OGL_COMBINE43_DISABLE)");
return false;
#else
return true; return true;
#endif
} }
// ********************************* // *********************************

View file

@ -1425,6 +1425,11 @@ void CDriverGL::setupSpecularPass(uint pass)
} }
else else
{ {
// Disabled because of Intel GPU texture bug (issue 310)
// CMake options to debug
// -DDEBUG_OGL_SPECULAR_FALLBACK=ON enables this
// -DDEBUG_OGL_COMBINE43_DISABLE=ON disables GL_NV_texture_env_combine4/GL_ATI_texture_env_combine3
#ifdef DEBUG_OGL_SPECULAR_FALLBACK
// Multiply texture1 by alpha_texture0 and display with add // Multiply texture1 by alpha_texture0 and display with add
_DriverGLStates.enableBlend(true); _DriverGLStates.enableBlend(true);
_DriverGLStates.blendFunc(GL_ONE, GL_ONE); _DriverGLStates.blendFunc(GL_ONE, GL_ONE);
@ -1457,6 +1462,7 @@ void CDriverGL::setupSpecularPass(uint pass)
} }
activateTexEnvMode(1, env); activateTexEnvMode(1, env);
#endif // DEBUG_OGL_SPECULAR_FALLBACK
} }
} }
} }