From 6947a58ba139ae0a83dd0e0e9009be093494d375 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 24 Oct 2013 03:59:21 +0200 Subject: [PATCH] Removed fixed embm stuff. --HG-- branch : gsoc2013-dfighter --- .../src/3d/driver/opengl3/driver_opengl.cpp | 64 +------------------ .../nel/src/3d/driver/opengl3/driver_opengl.h | 2 - .../opengl3/driver_opengl_extension.cpp | 20 ------ .../driver/opengl3/driver_opengl_extension.h | 3 - .../driver/opengl3/driver_opengl_texture.cpp | 2 +- 5 files changed, 3 insertions(+), 88 deletions(-) diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl.cpp index 552f2bcb2..89fe8dd57 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl.cpp @@ -279,8 +279,6 @@ CDriverGL3::CDriverGL3() _LightMapLastStageEnv.Env.SrcArg0Alpha= CMaterial::Texture; _LightMapLastStageEnv.Env.OpArg0Alpha= CMaterial::SrcAlpha; - std::fill(_StageSupportEMBM, _StageSupportEMBM + IDRV_MAT_MAXTEXTURES, false); - ATIWaterShaderHandleNoDiffuseMap = 0; ATIWaterShaderHandle = 0; ATICloudShaderHandle = 0; @@ -1273,8 +1271,7 @@ bool CDriverGL3::supportEMBM() const { H_AUTO_OGL(CDriverGL3_supportEMBM); - // For now, supported via ATI extension - return _Extensions.ATIEnvMapBumpMap; + return true; } // *************************************************************************** @@ -1282,9 +1279,8 @@ bool CDriverGL3::isEMBMSupportedAtStage(uint stage) const { H_AUTO_OGL(CDriverGL3_isEMBMSupportedAtStage) - nlassert(supportEMBM()); nlassert(stage < IDRV_MAT_MAXTEXTURES); - return _StageSupportEMBM[stage]; + return true; } // *************************************************************************** @@ -1292,14 +1288,7 @@ void CDriverGL3::setEMBMMatrix(const uint stage,const float mat[4]) { H_AUTO_OGL(CDriverGL3_setEMBMMatrix) - nlassert(supportEMBM()); nlassert(stage < IDRV_MAT_MAXTEXTURES); - // - if (_Extensions.ATIEnvMapBumpMap) - { - _DriverGLStates.activeTextureARB(stage); - nglTexBumpParameterfvATI(GL_BUMP_ROT_MATRIX_ATI, const_cast(mat)); - } } // *************************************************************************** @@ -1307,55 +1296,6 @@ void CDriverGL3::initEMBM() { H_AUTO_OGL(CDriverGL3_initEMBM); - if (supportEMBM()) - { - std::fill(_StageSupportEMBM, _StageSupportEMBM + IDRV_MAT_MAXTEXTURES, false); - if (_Extensions.ATIEnvMapBumpMap) - { - // Test which stage support EMBM - GLint numEMBMUnits; - - nglGetTexBumpParameterivATI(GL_BUMP_NUM_TEX_UNITS_ATI, &numEMBMUnits); - - std::vector EMBMUnits(numEMBMUnits); - - // get array of units that supports EMBM - nglGetTexBumpParameterivATI(GL_BUMP_TEX_UNITS_ATI, &EMBMUnits[0]); - - numEMBMUnits = std::min(numEMBMUnits, (GLint) _Extensions.NbTextureStages); - - EMBMUnits.resize(numEMBMUnits); - - uint k; - for(k = 0; k < EMBMUnits.size(); ++k) - { - uint stage = EMBMUnits[k] - GL_TEXTURE0_ARB; - if (stage < (IDRV_MAT_MAXTEXTURES - 1)) - { - _StageSupportEMBM[stage] = true; - } - } - // setup each stage to apply the bump map to the next stage (or previous if there's an unit at the last stage) - for(k = 0; k < (uint) _Extensions.NbTextureStages; ++k) - { - if (_StageSupportEMBM[k]) - { - // setup each stage so that it apply EMBM on the next stage - _DriverGLStates.activeTextureARB(k); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); - if (k != (uint) (_Extensions.NbTextureStages - 1)) - { - glTexEnvi(GL_TEXTURE_ENV, GL_BUMP_TARGET_ATI, GL_TEXTURE0_ARB + k + 1); - } - else - { - glTexEnvi(GL_TEXTURE_ENV, GL_BUMP_TARGET_ATI, GL_TEXTURE0_ARB); - } - } - } - _DriverGLStates.activeTextureARB(0); - } - } } // *************************************************************************** diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl.h b/code/nel/src/3d/driver/opengl3/driver_opengl.h index 708eea683..b82b8b8c6 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl.h +++ b/code/nel/src/3d/driver/opengl3/driver_opengl.h @@ -953,8 +953,6 @@ private: CTexEnvSpecial _CurrentTexEnvSpecial[IDRV_MAT_MAXTEXTURES]; // Texture addressing mode GLenum _CurrentTexAddrMode[IDRV_MAT_MAXTEXTURES]; - // Which stages support EMBM - bool _StageSupportEMBM[IDRV_MAT_MAXTEXTURES]; // Anisotropic filtering value float _AnisotropicFilter; diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl_extension.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl_extension.cpp index ac4828c21..d17b55a4b 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl_extension.cpp @@ -610,25 +610,6 @@ static bool setupATIXTextureEnvRoute(const char * /* glext */) // return true; } -// ********************************* -static bool setupATIEnvMapBumpMap(const char *glext) -{ - H_AUTO_OGL(setupATIEnvMapBumpMap); - CHECK_EXT("GL_ATI_envmap_bumpmap"); - - GLint num = -1; - - CHECK_ADDRESS(PFNGLTEXBUMPPARAMETERIVATIPROC, glTexBumpParameterivATI); - CHECK_ADDRESS(PFNGLTEXBUMPPARAMETERFVATIPROC, glTexBumpParameterfvATI); - CHECK_ADDRESS(PFNGLGETTEXBUMPPARAMETERIVATIPROC, glGetTexBumpParameterivATI); - CHECK_ADDRESS(PFNGLGETTEXBUMPPARAMETERFVATIPROC, glGetTexBumpParameterfvATI); - - // Check for broken ATI drivers and disable EMBM if we caught one. - // Reminder: This code crashes with Catalyst 7.11 fglrx drivers! - nglGetTexBumpParameterivATI(GL_BUMP_NUM_TEX_UNITS_ATI, &num); - - return num > 0; -} // ********************************* static bool setupARBTextureCubeMap(const char *glext) @@ -1174,7 +1155,6 @@ void registerGlExtensions(CGlExtensions &ext) setupARBVertexProgram(glext); - ext.ATIEnvMapBumpMap = setupATIEnvMapBumpMap(glext); ext.ATIFragmentShader = setupATIFragmentShader(glext); setupARBFragmentProgram(glext); diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl_extension.h b/code/nel/src/3d/driver/opengl3/driver_opengl_extension.h index ca95ffbc9..63dbf163b 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl_extension.h +++ b/code/nel/src/3d/driver/opengl3/driver_opengl_extension.h @@ -73,7 +73,6 @@ struct CGlExtensions // ATI Extensions. bool ATITextureEnvCombine3; - bool ATIEnvMapBumpMap; bool ATIFragmentShader; bool ATIXTextureEnvRoute; @@ -104,7 +103,6 @@ public: GLXSGISwapControl= false; GLXMESASwapControl= false; EXTBlendColor= false; - ATIEnvMapBumpMap = false; ATIFragmentShader = false; NVTextureRectangle = false; EXTTextureRectangle = false; @@ -135,7 +133,6 @@ public: result += ATITextureEnvCombine3 ? "ATITextureEnvCombine3 " : ""; result += ATIXTextureEnvRoute ? "ATITextureEnvRoute " : ""; result += ARBTextureCubeMap ? "ARBTextureCubeMap " : ""; - result += ATIEnvMapBumpMap ? "ATIEnvMapBumpMap " : ""; result += NVTextureRectangle ? "NVTextureRectangle " : ""; result += EXTTextureRectangle ? "EXTTextureRectangle " : ""; result += ARBTextureRectangle ? "ARBTextureRectangle " : ""; diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl_texture.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl_texture.cpp index f2513292e..10a91931d 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl_texture.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl_texture.cpp @@ -371,7 +371,7 @@ GLint CDriverGL3::getGlTextureFormat(ITexture& tex, bool &compressed) case ITexture::Alpha: return GL_ALPHA8; case ITexture::AlphaLuminance: return GL_LUMINANCE8_ALPHA8; case ITexture::DsDt: - if (_Extensions.ATIEnvMapBumpMap || _Extensions.ATIFragmentShader) + if ( _Extensions.ATIFragmentShader) { return GL_DU8DV8_ATI; }