In OpenGL 3+ we cannot disable HW VBO since it's mandatory, also Vertex Programs are mandatory too, so they must be abailable. No need to check for them!

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 11 years ago
parent a81db21e0a
commit 82d29b3e23

@ -576,20 +576,6 @@ bool CDriverGL3::activeFrameBufferObject(ITexture * tex)
return false;
}
// --------------------------------------------------
void CDriverGL3::disableHardwareVertexProgram()
{
H_AUTO_OGL(CDriverGL3_disableHardwareVertexProgram)
_Extensions.DisableHardwareVertexProgram= true;
}
// ***************************************************************************
void CDriverGL3::disableHardwareVertexArrayAGP()
{
H_AUTO_OGL(CDriverGL3_disableHardwareVertexArrayAGP)
_Extensions.DisableHardwareVertexArrayAGP= true;
}
// ***************************************************************************
void CDriverGL3::disableHardwareTextureShader()
{
@ -1266,7 +1252,6 @@ bool CDriverGL3::isWaterShaderSupported() const
if(_Extensions.ARBFragmentProgram && ARBWaterShader[0] != 0) return true;
if (!_Extensions.ARBVertexProgram) return false; // should support vertex programs
if (!_Extensions.NVTextureShader && !_Extensions.ATIFragmentShader && !_Extensions.ARBFragmentProgram) return false;
return true;
}
@ -1331,13 +1316,11 @@ void CDriverGL3::checkForPerPixelLightingSupport()
_SupportPerPixelShaderNoSpec = (_Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3)
&& _Extensions.ARBTextureCubeMap
&& _Extensions.NbTextureStages >= 3
&& ( _Extensions.ARBVertexProgram );
&& _Extensions.NbTextureStages >= 3;
_SupportPerPixelShader = (_Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3)
&& _Extensions.ARBTextureCubeMap
&& _Extensions.NbTextureStages >= 2
&& ( _Extensions.ARBVertexProgram );
&& _Extensions.NbTextureStages >= 2;
}
// ***************************************************************************

@ -293,8 +293,8 @@ public:
virtual bool init (uint windowIcon = 0, emptyProc exitFunc = 0);
virtual void disableHardwareVertexProgram();
virtual void disableHardwareVertexArrayAGP();
virtual void disableHardwareVertexProgram(){}
virtual void disableHardwareVertexArrayAGP(){}
virtual void disableHardwareTextureShader();
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable) throw(EBadDisplay);
@ -408,7 +408,7 @@ public:
virtual void getNumPerStageConstant(uint &lightedMaterial, uint &unlightedMaterial) const;
virtual bool supportVertexBufferHard() const;
virtual bool supportVertexBufferHard() const{ return true; };
virtual bool supportVolatileVertexBuffer() const;
@ -1267,7 +1267,7 @@ private:
/// \name Vertex program interface
// @{
bool isVertexProgramSupported () const;
bool isVertexProgramSupported () const{ return true; }
bool isVertexProgramEmulated () const{ return false; }
bool activeVertexProgram (CVertexProgram *program);
void setConstant (uint index, float, float, float, float);
@ -1279,7 +1279,7 @@ private:
void setConstantMatrix (uint index, IDriver::TMatrix matrix, IDriver::TTransform transform);
void setConstantFog (uint index);
void enableVertexProgramDoubleSidedColor(bool doubleSided);
bool supportVertexProgramDoubleSidedColor() const;
bool supportVertexProgramDoubleSidedColor() const{ return true; };
virtual bool supportMADOperator() const ;

@ -439,26 +439,6 @@ static bool setupARBTextureNonPowerOfTwo(const char *glext)
return true;
}
// ***************************************************************************
static bool setupOESMapBuffer(const char *glext)
{
H_AUTO_OGL(setupOESMapBuffer);
CHECK_EXT("OES_mapbuffer");
return true;
}
// ***************************************************************************
static bool setupOESDrawTexture(const char *glext)
{
H_AUTO_OGL(setupOESDrawTexture);
CHECK_EXT("OES_draw_texture");
return true;
}
// *********************************
static bool setupEXTTextureCompressionS3TC(const char *glext)
{
@ -978,19 +958,7 @@ void registerGlExtensions(CGlExtensions &ext)
// Check for cube mapping
ext.ARBTextureCubeMap = setupARBTextureCubeMap(glext);
// Check vertex program
// Disable feature ???
if(!ext.DisableHardwareVertexProgram)
{
ext.ARBVertexProgram= setupARBVertexProgram(glext);
}
else
{
ext.ARBVertexProgram = false;
}
ext.OESDrawTexture = setupOESDrawTexture(glext);
ext.OESMapBuffer = setupOESMapBuffer(glext);
setupARBVertexProgram(glext);
// Check texture shaders
// Disable feature ???

@ -87,15 +87,10 @@ struct CGlExtensions
bool ARBTextureNonPowerOfTwo;
bool ARBMultisample;
bool OESDrawTexture;
bool OESMapBuffer;
public:
/// \name Disable Hardware feature. False by default. setuped by IDriver
// @{
bool DisableHardwareVertexProgram;
bool DisableHardwareVertexArrayAGP;
bool DisableHardwareTextureShader;
// @}
@ -142,12 +137,7 @@ public:
PackedDepthStencil = false;
NVStateVARWithoutFlush = 0;
OESDrawTexture = false;
OESMapBuffer = false;
/// \name Disable Hardware feature. False by default. setuped by IDriver
DisableHardwareVertexProgram= false;
DisableHardwareVertexArrayAGP= false;
DisableHardwareTextureShader= false;
}

@ -642,14 +642,6 @@ void CDriverGL3::mapTextureStageToUV(uint stage, uint uv)
// ***************************************************************************
// ***************************************************************************
// ***************************************************************************
bool CDriverGL3::supportVertexBufferHard() const
{
H_AUTO_OGL(CDriverGL3_supportVertexBufferHard)
return true;
}
// ***************************************************************************
bool CDriverGL3::supportVolatileVertexBuffer() const
{
@ -998,7 +990,6 @@ void CDriverGL3::setupGlArrays(CVertexBufferInfo &vb)
{
H_AUTO_OGL(CDriverGL3_setupGlArrays)
if (_Extensions.ARBVertexProgram)
{
toggleGlArraysForARBVertexProgram();
// Use a vertex program ?
@ -1011,11 +1002,6 @@ void CDriverGL3::setupGlArrays(CVertexBufferInfo &vb)
setupGlArraysForARBVertexProgram(vb);
}
}
else
{
// no vertex programs
setupGlArraysStd(vb);
}
}
@ -1081,8 +1067,6 @@ void CDriverGL3::resetVertexArrayRange()
bool CDriverGL3::initVertexBufferHard(uint agpMem, uint vramMem)
{
H_AUTO_OGL(CDriverGL3_initVertexBufferHard)
if(!supportVertexBufferHard())
return false;
// must be supported
if(!_AGPVertexArrayRange || !_VRAMVertexArrayRange)

@ -48,14 +48,6 @@ CVertexProgamDrvInfosGL3::CVertexProgamDrvInfosGL3 (CDriverGL3 *drv, ItVtxPrgDrv
}
// ***************************************************************************
bool CDriverGL3::isVertexProgramSupported () const
{
H_AUTO_OGL(CVertexProgamDrvInfosGL_isVertexProgramSupported)
return _Extensions.ARBVertexProgram;
}
//=================================================================================================
static const char *ARBVertexProgramInstrToName[] =
{
@ -586,26 +578,14 @@ void CDriverGL3::enableVertexProgramDoubleSidedColor(bool doubleSided)
{
H_AUTO_OGL(CDriverGL3_enableVertexProgramDoubleSidedColor);
// Vertex program exist ?
if (_Extensions.ARBVertexProgram)
{
// change mode (not cached because supposed to be rare)
if(doubleSided)
glEnable (GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
else
glDisable (GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
}
// change mode (not cached because supposed to be rare)
if(doubleSided)
glEnable (GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
else
glDisable (GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
}
// ***************************************************************************
bool CDriverGL3::supportVertexProgramDoubleSidedColor() const
{
H_AUTO_OGL(CDriverGL3_supportVertexProgramDoubleSidedColor)
// currently only supported by NV_VERTEX_PROGRAM && ARB_VERTEX_PROGRAM
return _Extensions.ARBVertexProgram;
}
#ifdef NL_STATIC
} // NLDRIVERGL/ES
#endif

Loading…
Cancel
Save