Removed fixed embm stuff.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 11 years ago
parent 8276cb0140
commit 6947a58ba1

@ -279,8 +279,6 @@ CDriverGL3::CDriverGL3()
_LightMapLastStageEnv.Env.SrcArg0Alpha= CMaterial::Texture; _LightMapLastStageEnv.Env.SrcArg0Alpha= CMaterial::Texture;
_LightMapLastStageEnv.Env.OpArg0Alpha= CMaterial::SrcAlpha; _LightMapLastStageEnv.Env.OpArg0Alpha= CMaterial::SrcAlpha;
std::fill(_StageSupportEMBM, _StageSupportEMBM + IDRV_MAT_MAXTEXTURES, false);
ATIWaterShaderHandleNoDiffuseMap = 0; ATIWaterShaderHandleNoDiffuseMap = 0;
ATIWaterShaderHandle = 0; ATIWaterShaderHandle = 0;
ATICloudShaderHandle = 0; ATICloudShaderHandle = 0;
@ -1273,8 +1271,7 @@ bool CDriverGL3::supportEMBM() const
{ {
H_AUTO_OGL(CDriverGL3_supportEMBM); H_AUTO_OGL(CDriverGL3_supportEMBM);
// For now, supported via ATI extension return true;
return _Extensions.ATIEnvMapBumpMap;
} }
// *************************************************************************** // ***************************************************************************
@ -1282,9 +1279,8 @@ bool CDriverGL3::isEMBMSupportedAtStage(uint stage) const
{ {
H_AUTO_OGL(CDriverGL3_isEMBMSupportedAtStage) H_AUTO_OGL(CDriverGL3_isEMBMSupportedAtStage)
nlassert(supportEMBM());
nlassert(stage < IDRV_MAT_MAXTEXTURES); 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) H_AUTO_OGL(CDriverGL3_setEMBMMatrix)
nlassert(supportEMBM());
nlassert(stage < IDRV_MAT_MAXTEXTURES); nlassert(stage < IDRV_MAT_MAXTEXTURES);
//
if (_Extensions.ATIEnvMapBumpMap)
{
_DriverGLStates.activeTextureARB(stage);
nglTexBumpParameterfvATI(GL_BUMP_ROT_MATRIX_ATI, const_cast<float *>(mat));
}
} }
// *************************************************************************** // ***************************************************************************
@ -1307,55 +1296,6 @@ void CDriverGL3::initEMBM()
{ {
H_AUTO_OGL(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<GLint> 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);
}
}
} }
// *************************************************************************** // ***************************************************************************

@ -953,8 +953,6 @@ private:
CTexEnvSpecial _CurrentTexEnvSpecial[IDRV_MAT_MAXTEXTURES]; CTexEnvSpecial _CurrentTexEnvSpecial[IDRV_MAT_MAXTEXTURES];
// Texture addressing mode // Texture addressing mode
GLenum _CurrentTexAddrMode[IDRV_MAT_MAXTEXTURES]; GLenum _CurrentTexAddrMode[IDRV_MAT_MAXTEXTURES];
// Which stages support EMBM
bool _StageSupportEMBM[IDRV_MAT_MAXTEXTURES];
// Anisotropic filtering value // Anisotropic filtering value
float _AnisotropicFilter; float _AnisotropicFilter;

@ -610,25 +610,6 @@ static bool setupATIXTextureEnvRoute(const char * /* glext */)
// return true; // 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) static bool setupARBTextureCubeMap(const char *glext)
@ -1174,7 +1155,6 @@ void registerGlExtensions(CGlExtensions &ext)
setupARBVertexProgram(glext); setupARBVertexProgram(glext);
ext.ATIEnvMapBumpMap = setupATIEnvMapBumpMap(glext);
ext.ATIFragmentShader = setupATIFragmentShader(glext); ext.ATIFragmentShader = setupATIFragmentShader(glext);
setupARBFragmentProgram(glext); setupARBFragmentProgram(glext);

@ -73,7 +73,6 @@ struct CGlExtensions
// ATI Extensions. // ATI Extensions.
bool ATITextureEnvCombine3; bool ATITextureEnvCombine3;
bool ATIEnvMapBumpMap;
bool ATIFragmentShader; bool ATIFragmentShader;
bool ATIXTextureEnvRoute; bool ATIXTextureEnvRoute;
@ -104,7 +103,6 @@ public:
GLXSGISwapControl= false; GLXSGISwapControl= false;
GLXMESASwapControl= false; GLXMESASwapControl= false;
EXTBlendColor= false; EXTBlendColor= false;
ATIEnvMapBumpMap = false;
ATIFragmentShader = false; ATIFragmentShader = false;
NVTextureRectangle = false; NVTextureRectangle = false;
EXTTextureRectangle = false; EXTTextureRectangle = false;
@ -135,7 +133,6 @@ public:
result += ATITextureEnvCombine3 ? "ATITextureEnvCombine3 " : ""; result += ATITextureEnvCombine3 ? "ATITextureEnvCombine3 " : "";
result += ATIXTextureEnvRoute ? "ATITextureEnvRoute " : ""; result += ATIXTextureEnvRoute ? "ATITextureEnvRoute " : "";
result += ARBTextureCubeMap ? "ARBTextureCubeMap " : ""; result += ARBTextureCubeMap ? "ARBTextureCubeMap " : "";
result += ATIEnvMapBumpMap ? "ATIEnvMapBumpMap " : "";
result += NVTextureRectangle ? "NVTextureRectangle " : ""; result += NVTextureRectangle ? "NVTextureRectangle " : "";
result += EXTTextureRectangle ? "EXTTextureRectangle " : ""; result += EXTTextureRectangle ? "EXTTextureRectangle " : "";
result += ARBTextureRectangle ? "ARBTextureRectangle " : ""; result += ARBTextureRectangle ? "ARBTextureRectangle " : "";

@ -371,7 +371,7 @@ GLint CDriverGL3::getGlTextureFormat(ITexture& tex, bool &compressed)
case ITexture::Alpha: return GL_ALPHA8; case ITexture::Alpha: return GL_ALPHA8;
case ITexture::AlphaLuminance: return GL_LUMINANCE8_ALPHA8; case ITexture::AlphaLuminance: return GL_LUMINANCE8_ALPHA8;
case ITexture::DsDt: case ITexture::DsDt:
if (_Extensions.ATIEnvMapBumpMap || _Extensions.ATIFragmentShader) if ( _Extensions.ATIFragmentShader)
{ {
return GL_DU8DV8_ATI; return GL_DU8DV8_ATI;
} }

Loading…
Cancel
Save