Rename some functions to follow the same naming convention of others
This commit is contained in:
parent
b7294b9246
commit
95eb1499ee
19 changed files with 59 additions and 58 deletions
|
@ -1004,7 +1004,7 @@ public:
|
|||
/**
|
||||
* Does the driver supports vertex programs ?
|
||||
*/
|
||||
virtual bool isVertexProgramSupported () const =0;
|
||||
virtual bool supportVertexProgram () const =0;
|
||||
|
||||
/**
|
||||
* Does the driver supports vertex program, but emulated by CPU ?
|
||||
|
@ -1014,8 +1014,8 @@ public:
|
|||
/**
|
||||
* Does the driver supports pixel programs ?
|
||||
*/
|
||||
virtual bool isPixelProgramSupported() const =0;
|
||||
virtual bool isPixelProgramSupported(CPixelProgram::TProfile profile) const =0;
|
||||
virtual bool supportPixelProgram() const =0;
|
||||
virtual bool supportPixelProgram(CPixelProgram::TProfile profile) const =0;
|
||||
|
||||
|
||||
|
||||
|
@ -1122,10 +1122,10 @@ public:
|
|||
/// test whether the device supports some form of texture shader. (could be limited to DX6 EMBM for example)
|
||||
virtual bool supportTextureShaders() const = 0;
|
||||
// Is the shader water supported ? If not, the driver caller should implement its own version
|
||||
virtual bool isWaterShaderSupported() const = 0;
|
||||
virtual bool supportWaterShader() const = 0;
|
||||
//
|
||||
/// test whether a texture addressing mode is supported
|
||||
virtual bool isTextureAddrModeSupported(CMaterial::TTexAddressingMode mode) const = 0;
|
||||
virtual bool supportTextureAddrMode(CMaterial::TTexAddressingMode mode) const = 0;
|
||||
/** setup the 2D matrix for the OffsetTexture, OffsetTextureScale and OffsetTexture addressing mode
|
||||
* It should be stored as the following
|
||||
* [a0 a1]
|
||||
|
|
|
@ -2996,7 +2996,7 @@ bool CDriverD3D::stretchRect(ITexture * srcText, NLMISC::CRect &srcRect, ITextur
|
|||
|
||||
bool CDriverD3D::supportBloomEffect() const
|
||||
{
|
||||
return isVertexProgramSupported();
|
||||
return supportVertexProgram();
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -3339,9 +3339,9 @@ uint COcclusionQueryD3D::getVisibleCount()
|
|||
}
|
||||
|
||||
// ***************************************************************************
|
||||
bool CDriverD3D::isWaterShaderSupported() const
|
||||
bool CDriverD3D::supportWaterShader() const
|
||||
{
|
||||
H_AUTO_D3D(CDriverD3D_isWaterShaderSupported);
|
||||
H_AUTO_D3D(CDriverD3D_supportWaterShader);
|
||||
return _PixelShaderVersion >= D3DPS_VERSION(1, 1);
|
||||
}
|
||||
|
||||
|
@ -3627,7 +3627,7 @@ void CDriverD3D::CVertexProgramPtrState::apply(CDriverD3D *driver)
|
|||
void CDriverD3D::CPixelShaderPtrState::apply(CDriverD3D *driver)
|
||||
{
|
||||
H_AUTO_D3D(CDriverD3D_CPixelShaderPtrState);
|
||||
if (!driver->isPixelProgramSupported()) return;
|
||||
if (!driver->supportPixelProgram()) return;
|
||||
driver->_DeviceInterface->SetPixelShader(PixelShader);
|
||||
}
|
||||
|
||||
|
|
|
@ -973,9 +973,9 @@ public:
|
|||
virtual bool supportTextureShaders() const {return false;};
|
||||
virtual bool supportMADOperator() const;
|
||||
// todo hulud d3d adressing mode
|
||||
virtual bool isWaterShaderSupported() const;
|
||||
virtual bool supportWaterShader() const;
|
||||
// todo hulud d3d adressing mode
|
||||
virtual bool isTextureAddrModeSupported(CMaterial::TTexAddressingMode /* mode */) const {return false;};
|
||||
virtual bool supportTextureAddrMode(CMaterial::TTexAddressingMode /* mode */) const {return false;};
|
||||
// todo hulud d3d adressing mode
|
||||
virtual void setMatrix2DForTextureOffsetAddrMode(const uint /* stage */, const float /* mat */[4]) {}
|
||||
|
||||
|
@ -1006,9 +1006,9 @@ public:
|
|||
virtual void endMaterialMultiPass();
|
||||
|
||||
// Vertex program
|
||||
virtual bool isVertexProgramSupported () const;
|
||||
virtual bool isPixelProgramSupported () const;
|
||||
virtual bool isPixelProgramSupported (CPixelProgram::TProfile profile) const;
|
||||
virtual bool supportVertexProgram () const;
|
||||
virtual bool supportPixelProgram () const;
|
||||
virtual bool supportPixelProgram (CPixelProgram::TProfile profile) const;
|
||||
virtual bool isVertexProgramEmulated () const;
|
||||
virtual bool activeVertexProgram (CVertexProgram *program);
|
||||
virtual bool activePixelProgram (CPixelProgram *program);
|
||||
|
|
|
@ -54,15 +54,15 @@ CPixelProgramDrvInfosD3D::~CPixelProgramDrvInfosD3D()
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
bool CDriverD3D::isPixelProgramSupported () const
|
||||
bool CDriverD3D::supportPixelProgram () const
|
||||
{
|
||||
H_AUTO_D3D(CDriverD3D_isPixelProgramSupported)
|
||||
H_AUTO_D3D(CDriverD3D_supportPixelProgram)
|
||||
return _PixelProgram;
|
||||
}
|
||||
|
||||
bool CDriverD3D::isPixelProgramSupported (CPixelProgram::TProfile profile) const
|
||||
bool CDriverD3D::supportPixelProgram (CPixelProgram::TProfile profile) const
|
||||
{
|
||||
H_AUTO_D3D(CDriverD3D_isPixelProgramSupported_profile)
|
||||
H_AUTO_D3D(CDriverD3D_supportPixelProgram_profile)
|
||||
return ((profile & 0xFFFF0000) == 0xD3D00000)
|
||||
&& (_PixelProgramVersion >= (uint16)(profile & 0x0000FFFF));
|
||||
}
|
||||
|
|
|
@ -43,9 +43,9 @@ CVertexProgamDrvInfosD3D::~CVertexProgamDrvInfosD3D()
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
bool CDriverD3D::isVertexProgramSupported () const
|
||||
bool CDriverD3D::supportVertexProgram () const
|
||||
{
|
||||
H_AUTO_D3D(CDriverD3D_isVertexProgramSupported )
|
||||
H_AUTO_D3D(CDriverD3D_supportVertexProgram )
|
||||
return _VertexProgram;
|
||||
}
|
||||
|
||||
|
|
|
@ -691,7 +691,7 @@ bool CDriverGL::stretchRect(ITexture * /* srcText */, NLMISC::CRect &/* srcRect
|
|||
// ***************************************************************************
|
||||
bool CDriverGL::supportBloomEffect() const
|
||||
{
|
||||
return (isVertexProgramSupported() && supportFrameBufferObject() && supportPackedDepthStencil() && supportTextureRectangle());
|
||||
return (supportVertexProgram() && supportFrameBufferObject() && supportPackedDepthStencil() && supportTextureRectangle());
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -1539,9 +1539,9 @@ bool CDriverGL::supportTextureShaders() const
|
|||
}
|
||||
|
||||
// ***************************************************************************
|
||||
bool CDriverGL::isWaterShaderSupported() const
|
||||
bool CDriverGL::supportWaterShader() const
|
||||
{
|
||||
H_AUTO_OGL(CDriverGL_isWaterShaderSupported);
|
||||
H_AUTO_OGL(CDriverGL_supportWaterShader);
|
||||
|
||||
if(_Extensions.ARBFragmentProgram && ARBWaterShader[0] != 0) return true;
|
||||
|
||||
|
@ -1551,9 +1551,9 @@ bool CDriverGL::isWaterShaderSupported() const
|
|||
}
|
||||
|
||||
// ***************************************************************************
|
||||
bool CDriverGL::isTextureAddrModeSupported(CMaterial::TTexAddressingMode /* mode */) const
|
||||
bool CDriverGL::supportTextureAddrMode(CMaterial::TTexAddressingMode /* mode */) const
|
||||
{
|
||||
H_AUTO_OGL(CDriverGL_isTextureAddrModeSupported)
|
||||
H_AUTO_OGL(CDriverGL_supportTextureAddrMode)
|
||||
|
||||
if (_Extensions.NVTextureShader)
|
||||
{
|
||||
|
|
|
@ -601,9 +601,9 @@ public:
|
|||
// @{
|
||||
virtual bool supportTextureShaders() const;
|
||||
|
||||
virtual bool isWaterShaderSupported() const;
|
||||
virtual bool supportWaterShader() const;
|
||||
|
||||
virtual bool isTextureAddrModeSupported(CMaterial::TTexAddressingMode mode) const;
|
||||
virtual bool supportTextureAddrMode(CMaterial::TTexAddressingMode mode) const;
|
||||
|
||||
virtual void setMatrix2DForTextureOffsetAddrMode(const uint stage, const float mat[4]);
|
||||
// @}
|
||||
|
@ -1303,9 +1303,9 @@ private:
|
|||
/// \name Vertex program interface
|
||||
// @{
|
||||
|
||||
bool isVertexProgramSupported () const;
|
||||
bool isPixelProgramSupported () const;
|
||||
bool isPixelProgramSupported (CPixelProgram::TProfile profile) const;
|
||||
bool supportVertexProgram () const;
|
||||
bool supportPixelProgram () const;
|
||||
bool supportPixelProgram (CPixelProgram::TProfile profile) const;
|
||||
bool isVertexProgramEmulated () const;
|
||||
bool activeVertexProgram (CVertexProgram *program);
|
||||
bool activePixelProgram (CPixelProgram *program);
|
||||
|
|
|
@ -63,14 +63,14 @@ CPixelProgamDrvInfosGL::CPixelProgamDrvInfosGL (CDriverGL *drv, ItPixelPrgDrvInf
|
|||
}
|
||||
|
||||
// ***************************************************************************
|
||||
bool CDriverGL::isPixelProgramSupported() const
|
||||
bool CDriverGL::supportPixelProgram() const
|
||||
{
|
||||
H_AUTO_OGL(CPixelProgamDrvInfosGL_isPixelProgramSupported)
|
||||
H_AUTO_OGL(CPixelProgamDrvInfosGL_supportPixelProgram)
|
||||
return _Extensions.ARBFragmentProgram;
|
||||
}
|
||||
bool CDriverGL::isPixelProgramSupported(CPixelProgram::TProfile profile) const
|
||||
bool CDriverGL::supportPixelProgram(CPixelProgram::TProfile profile) const
|
||||
{
|
||||
H_AUTO_OGL(CPixelProgamDrvInfosGL_isPixelProgramSupported_profile)
|
||||
H_AUTO_OGL(CPixelProgamDrvInfosGL_supportPixelProgram_profile)
|
||||
switch (profile)
|
||||
{
|
||||
case CPixelProgram::arbfp1:
|
||||
|
@ -78,6 +78,7 @@ bool CDriverGL::isPixelProgramSupported(CPixelProgram::TProfile profile) const
|
|||
case CPixelProgram::fp40:
|
||||
return _Extensions.NVFragmentProgram2;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
|
|
@ -70,9 +70,9 @@ CVertexProgamDrvInfosGL::CVertexProgamDrvInfosGL (CDriverGL *drv, ItVtxPrgDrvInf
|
|||
|
||||
|
||||
// ***************************************************************************
|
||||
bool CDriverGL::isVertexProgramSupported () const
|
||||
bool CDriverGL::supportVertexProgram () const
|
||||
{
|
||||
H_AUTO_OGL(CVertexProgamDrvInfosGL_isVertexProgramSupported)
|
||||
H_AUTO_OGL(CVertexProgamDrvInfosGL_supportVertexProgram)
|
||||
return _Extensions.NVVertexProgram || _Extensions.EXTVertexShader || _Extensions.ARBVertexProgram;
|
||||
}
|
||||
|
||||
|
|
|
@ -574,7 +574,7 @@ void CLandscape::setDriver(IDriver *drv)
|
|||
|
||||
// Does the driver support VertexShader???
|
||||
// only if VP supported by GPU.
|
||||
_VertexShaderOk= (_Driver->isVertexProgramSupported() && !_Driver->isVertexProgramEmulated());
|
||||
_VertexShaderOk= (_Driver->supportVertexProgram() && !_Driver->isVertexProgramEmulated());
|
||||
|
||||
|
||||
// Does the driver has sufficient requirements for Vegetable???
|
||||
|
|
|
@ -82,7 +82,7 @@ void CLandscapeVBAllocator::updateDriver(IDriver *driver)
|
|||
deleteVertexProgram();
|
||||
// Then rebuild VB format, and VertexProgram, if needed.
|
||||
// Do it only if VP supported by GPU.
|
||||
setupVBFormatAndVertexProgram(_Driver->isVertexProgramSupported() && !_Driver->isVertexProgramEmulated());
|
||||
setupVBFormatAndVertexProgram(_Driver->supportVertexProgram() && !_Driver->isVertexProgramEmulated());
|
||||
|
||||
// must reallocate the VertexBuffer.
|
||||
if( _NumVerticesAllocated>0 )
|
||||
|
|
|
@ -428,7 +428,7 @@ bool CMeshVPPerPixelLight::begin(IDriver *drv,
|
|||
{
|
||||
// test if supported by driver
|
||||
if (!
|
||||
(drv->isVertexProgramSupported()
|
||||
(drv->supportVertexProgram()
|
||||
&& !drv->isVertexProgramEmulated()
|
||||
&& drv->supportPerPixelLighting(SpecularLighting)
|
||||
)
|
||||
|
|
|
@ -287,7 +287,7 @@ inline void CMeshVPWindTree::setupPerInstanceConstants(IDriver *driver, CScene
|
|||
// ***************************************************************************
|
||||
bool CMeshVPWindTree::begin(IDriver *driver, CScene *scene, CMeshBaseInstance *mbi, const NLMISC::CMatrix &invertedModelMat, const NLMISC::CVector & /*viewerPos*/)
|
||||
{
|
||||
if (!(driver->isVertexProgramSupported() && !driver->isVertexProgramEmulated())) return false;
|
||||
if (!(driver->supportVertexProgram() && !driver->isVertexProgramEmulated())) return false;
|
||||
|
||||
|
||||
// precompute mesh
|
||||
|
@ -367,7 +367,7 @@ bool CMeshVPWindTree::supportMeshBlockRendering() const
|
|||
// ***************************************************************************
|
||||
bool CMeshVPWindTree::isMBRVpOk(IDriver *driver) const
|
||||
{
|
||||
return driver->isVertexProgramSupported() && !driver->isVertexProgramEmulated();
|
||||
return driver->supportVertexProgram() && !driver->isVertexProgramEmulated();
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
|
|
@ -786,7 +786,7 @@ void CPSMultiTexturedParticle::setupMaterial(ITexture *primary, IDriver *driver,
|
|||
/// if bump is used, the matrix must be setupped each time (not a material field)
|
||||
if (!_ForceBasicCaps && isMultiTextureEnabled() && _MainOp == EnvBumpMap)
|
||||
{
|
||||
if (driver->isTextureAddrModeSupported(CMaterial::OffsetTexture))
|
||||
if (driver->supportTextureAddrMode(CMaterial::OffsetTexture))
|
||||
{
|
||||
CTextureBump *tb = dynamic_cast<CTextureBump *>((ITexture *) _Texture2);
|
||||
if (tb != NULL)
|
||||
|
@ -858,7 +858,7 @@ void CPSMultiTexturedParticle::setupMaterial(ITexture *primary, IDriver *driver,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!_ForceBasicCaps && (driver->isTextureAddrModeSupported(CMaterial::OffsetTexture) || driver->supportEMBM())) // envbumpmap supported ?
|
||||
if (!_ForceBasicCaps && (driver->supportTextureAddrMode(CMaterial::OffsetTexture) || driver->supportEMBM())) // envbumpmap supported ?
|
||||
{
|
||||
CTextureBump *tb = dynamic_cast<CTextureBump *>((ITexture *) _Texture2);
|
||||
if (tb != NULL)
|
||||
|
@ -917,7 +917,7 @@ void CPSMultiTexturedParticle::setupMultiTexEnv(TOperator op, ITexture *tex1, IT
|
|||
mat.enableTexAddrMode(false);
|
||||
break;
|
||||
case EnvBumpMap:
|
||||
if (drv.isTextureAddrModeSupported(CMaterial::OffsetTexture))
|
||||
if (drv.supportTextureAddrMode(CMaterial::OffsetTexture))
|
||||
{
|
||||
mat.setTexture(0, tex2);
|
||||
mat.setTexture(1, tex1);
|
||||
|
@ -1113,7 +1113,7 @@ void CPSMultiTexturedParticle::enumTexs(std::vector<NLMISC::CSmartPtr<ITexture>
|
|||
NL_PS_FUNC(CPSMultiTexturedParticle_enumTexs)
|
||||
if (_MainOp == EnvBumpMap && !_ForceBasicCaps)
|
||||
{
|
||||
if (drv.isTextureAddrModeSupported(CMaterial::OffsetTexture) || drv.supportEMBM())
|
||||
if (drv.supportTextureAddrMode(CMaterial::OffsetTexture) || drv.supportEMBM())
|
||||
{
|
||||
if (_Texture2) dest.push_back(_Texture2);
|
||||
}
|
||||
|
@ -1132,7 +1132,7 @@ bool CPSMultiTexturedParticle::isAlternateTextureUsed(IDriver &driver) const
|
|||
NL_PS_FUNC(CPSMultiTexturedParticle_isAlternateTextureUsed)
|
||||
if (!isTouched() && areBasicCapsForcedLocal() == areBasicCapsForced()) return (_MultiTexState & AlternateTextureUsed) != 0;
|
||||
if (_MainOp != EnvBumpMap) return false;
|
||||
return _ForceBasicCaps || (!driver.isTextureAddrModeSupported(CMaterial::OffsetTexture) && !driver.supportEMBM());
|
||||
return _ForceBasicCaps || (!driver.supportTextureAddrMode(CMaterial::OffsetTexture) && !driver.supportEMBM());
|
||||
}
|
||||
|
||||
} // NL3D
|
||||
|
|
|
@ -98,7 +98,7 @@ void CVegetableVBAllocator::updateDriver(IDriver *driver)
|
|||
_VBHardOk= false;
|
||||
|
||||
// Driver must support VP.
|
||||
nlassert(_Driver->isVertexProgramSupported());
|
||||
nlassert(_Driver->supportVertexProgram());
|
||||
|
||||
// must reallocate the VertexBuffer.
|
||||
if( _NumVerticesAllocated>0 )
|
||||
|
|
|
@ -61,7 +61,7 @@ void CWaterModel::setupVertexBuffer(CVertexBuffer &vb, uint numWantedVertices, I
|
|||
vb.setNumVertices(0);
|
||||
vb.setName("Water");
|
||||
vb.setPreferredMemory(CVertexBuffer::AGPPreferred, false);
|
||||
if (drv->isWaterShaderSupported())
|
||||
if (drv->supportWaterShader())
|
||||
{
|
||||
vb.setVertexFormat(CVertexBuffer::PositionFlag);
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ void CWaterModel::traverseRender()
|
|||
|
||||
|
||||
#ifndef FORCE_SIMPLE_WATER_RENDER
|
||||
if (!drv->isWaterShaderSupported())
|
||||
if (!drv->supportWaterShader())
|
||||
#endif
|
||||
{
|
||||
doSimpleRender(drv);
|
||||
|
@ -1363,7 +1363,7 @@ uint CWaterModel::getNumWantedVertices()
|
|||
uint CWaterModel::fillVB(void *datas, uint startTri, IDriver &drv)
|
||||
{
|
||||
H_AUTO( NL3D_Water_Render );
|
||||
if (drv.isWaterShaderSupported())
|
||||
if (drv.supportWaterShader())
|
||||
{
|
||||
return fillVBHard(datas, startTri);
|
||||
}
|
||||
|
@ -1657,7 +1657,7 @@ void CWaterModel::traverseRender()
|
|||
drv->setupModelMatrix(modelMat);
|
||||
bool isAbove = obsPos.z > getWorldMatrix().getPos().z;
|
||||
CVertexBuffer &vb = renderTrav.Scene->getWaterVB();
|
||||
if (drv->isWaterShaderSupported())
|
||||
if (drv->supportWaterShader())
|
||||
{
|
||||
setupMaterialNVertexShader(drv, shape, obsPos, isAbove, zHeight);
|
||||
nlassert(vb.getNumVertices() > 0);
|
||||
|
|
|
@ -372,7 +372,7 @@ void CWaterShape::flushTextures (IDriver &driver, uint selectedTexture)
|
|||
|
||||
/*
|
||||
if (
|
||||
(driver.supportTextureShaders() && driver.isTextureAddrModeSupported(CMaterial::OffsetTexture))
|
||||
(driver.supportTextureShaders() && driver.supportTextureAddrMode(CMaterial::OffsetTexture))
|
||||
|| driver.supportEMBM()
|
||||
)
|
||||
{
|
||||
|
|
|
@ -560,7 +560,7 @@ void CDecalRenderList::renderAllDecals()
|
|||
NL3D::IDriver *drvInternal = ((CDriverUser *) Driver)->getDriver();
|
||||
//
|
||||
static volatile bool forceNoVertexProgram = false;
|
||||
if (drvInternal->isVertexProgramSupported() && !forceNoVertexProgram)
|
||||
if (drvInternal->supportVertexProgram() && !forceNoVertexProgram)
|
||||
{
|
||||
//drvInternal->setConstantMatrix(0, NL3D::IDriver::ModelViewProjection, NL3D::IDriver::Identity);
|
||||
drvInternal->setConstant(7, _DistScale, _DistBias, 0.f, 1.f);
|
||||
|
|
|
@ -339,28 +339,28 @@ void initCommands()
|
|||
"mov oC0.xzw, c0.xyyx\n"
|
||||
"texld oC0.y, v0, s0\n";
|
||||
NL3D::IDriver *d = dynamic_cast<NL3D::CDriverUser *>(Driver)->getDriver();
|
||||
if (d->isPixelProgramSupported(CPixelProgram::fp40))
|
||||
if (d->supportPixelProgram(CPixelProgram::fp40))
|
||||
{
|
||||
nldebug("fp40");
|
||||
a_DevPixelProgram = new CPixelProgram(program_fp40);
|
||||
}
|
||||
else if (d->isPixelProgramSupported(CPixelProgram::arbfp1))
|
||||
else if (d->supportPixelProgram(CPixelProgram::arbfp1))
|
||||
{
|
||||
nldebug("arbfp1");
|
||||
a_DevPixelProgram = new CPixelProgram(program_arbfp1);
|
||||
}
|
||||
/*else if (d->isPixelProgramSupported(CPixelProgram::ps_3_0))
|
||||
/*else if (d->supportPixelProgram(CPixelProgram::ps_3_0))
|
||||
{
|
||||
nldebug("ps_3_0");
|
||||
a_DevPixelProgram = new CPixelProgram(program_ps_3_0);
|
||||
// Textures do not seem to work with ps_3_0...
|
||||
}*/
|
||||
else if (d->isPixelProgramSupported(CPixelProgram::ps_2_0))
|
||||
else if (d->supportPixelProgram(CPixelProgram::ps_2_0))
|
||||
{
|
||||
nldebug("ps_2_0");
|
||||
a_DevPixelProgram = new CPixelProgram(program_ps_2_0);
|
||||
}
|
||||
else if (d->isPixelProgramSupported(CPixelProgram::ps_1_1))
|
||||
else if (d->supportPixelProgram(CPixelProgram::ps_1_1))
|
||||
{
|
||||
nldebug("ps_1_1");
|
||||
a_DevPixelProgram = new CPixelProgram(program_ps_1_1);
|
||||
|
|
Loading…
Reference in a new issue