From 5e69d558ecb8124976563f0edaaf459e4f87dceb Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 1 Aug 2013 05:49:30 +0200 Subject: [PATCH] Since we use HW VBO, we don't need to actually check for it. --HG-- branch : gsoc2013-dfighter --- .../src/3d/driver/OpenGL3/driver_opengl.cpp | 20 ++++--------------- .../nel/src/3d/driver/OpenGL3/driver_opengl.h | 3 --- .../OpenGL3/driver_opengl_extension.cpp | 8 -------- .../driver/OpenGL3/driver_opengl_extension.h | 4 +--- .../driver/OpenGL3/driver_opengl_vertex.cpp | 8 ++------ 5 files changed, 7 insertions(+), 36 deletions(-) diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp index 595dbee11..01ae32762 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp @@ -249,9 +249,7 @@ CDriverGL3::CDriverGL3() _CurrentVertexBufferHard= NULL; _NVCurrentVARPtr= NULL; _NVCurrentVARSize= 0; - _SupportVBHard= false; _SlowUnlockVBHard= false; - _MaxVerticesByVBHard= 0; _AllocatedTextureMemory= 0; @@ -436,18 +434,10 @@ bool CDriverGL3::setupDisplay() _LastSetupGLArrayVertexProgram= false; // Init VertexArrayRange according to supported extenstion. - _SupportVBHard= false; _SlowUnlockVBHard= false; - _MaxVerticesByVBHard= 0; - // Try with ARB ext first. - if (_Extensions.ARBVertexBufferObject) - { - _AGPVertexArrayRange= new CVertexArrayRangeARB(this); - _VRAMVertexArrayRange= new CVertexArrayRangeARB(this); - _SupportVBHard= true; - _MaxVerticesByVBHard = std::numeric_limits::max(); // cant' know the value.. - } + _AGPVertexArrayRange= new CVertexArrayRangeARB(this); + _VRAMVertexArrayRange= new CVertexArrayRangeARB(this); // Reset VertexArrayRange. _CurrentVertexArrayRange= NULL; @@ -455,9 +445,7 @@ bool CDriverGL3::setupDisplay() _NVCurrentVARPtr= NULL; _NVCurrentVARSize= 0; - if( _SupportVBHard ) - initVertexBufferHard(NL3D_DRV_VERTEXARRAY_AGP_INIT_SIZE, 0); - + initVertexBufferHard(NL3D_DRV_VERTEXARRAY_AGP_INIT_SIZE, 0); // Init embm if present //=========================================================== @@ -744,7 +732,7 @@ bool CDriverGL3::swapBuffers() /* Yoyo: must do this (GeForce bug ??) else weird results if end render with a VBHard. Setup a std vertex buffer to ensure NVidia synchronisation. */ - if (!_Extensions.ARBVertexBufferObject ) + if( false ) { static CVertexBuffer dummyVB; static bool dummyVBinit= false; diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl.h index f26f6c09f..acd71fa64 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl.h @@ -1232,10 +1232,7 @@ private: void *_NVCurrentVARPtr; uint32 _NVCurrentVARSize; - // Info got from ATI or NVidia extension. - bool _SupportVBHard; bool _SlowUnlockVBHard; - uint32 _MaxVerticesByVBHard; // The AGP VertexArrayRange. IVertexArrayRange *_AGPVertexArrayRange; 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 d5f02b4f1..5bcb63b0b 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp @@ -1320,14 +1320,6 @@ void registerGlExtensions(CGlExtensions &ext) ext.ATITextureEnvCombine3= setupATITextureEnvCombine3(glext); // Check ATIXTextureEnvRoute ext.ATIXTextureEnvRoute= setupATIXTextureEnvRoute(glext); - - // ARB extensions - // ------------- - if(!ext.DisableHardwareVertexArrayAGP) - { - ext.ARBVertexBufferObject = setupARBVertexBufferObject(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 356180c15..f274f658f 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h @@ -87,7 +87,6 @@ struct CGlExtensions // ARB Extensions bool ARBTextureCompression; bool ARBFragmentProgram; - bool ARBVertexBufferObject; bool ARBVertexProgram; bool ARBTextureNonPowerOfTwo; bool ARBMultisample; @@ -135,7 +134,6 @@ public: ATIFragmentShader = false; EXTVertexShader= false; ARBFragmentProgram = false; - ARBVertexBufferObject = false; ARBVertexProgram = false; NVTextureRectangle = false; EXTTextureRectangle = false; @@ -216,7 +214,7 @@ public: #endif result += "\n Array/VBO: "; - result += ARBVertexBufferObject ? "ARB VBO " : ""; + result += "VertexBufferObject"; result += "\n FBO: "; result += FrameBufferObject ? "FramebufferObject " : ""; diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp index 00eb66ffb..c231d7ad7 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp @@ -701,7 +701,7 @@ void CDriverGL3::mapTextureStageToUV(uint stage, uint uv) bool CDriverGL3::supportVertexBufferHard() const { H_AUTO_OGL(CDriverGL3_supportVertexBufferHard) - return _SupportVBHard; + return true; } // *************************************************************************** @@ -725,7 +725,7 @@ bool CDriverGL3::slowUnlockVertexBufferHard() const uint CDriverGL3::getMaxVerticesByVertexBufferHard() const { H_AUTO_OGL(CDriverGL3_getMaxVerticesByVertexBufferHard) - return _MaxVerticesByVBHard; + return std::numeric_limits::max(); } @@ -755,10 +755,6 @@ IVertexBufferHardGL *CDriverGL3::createVertexBufferHard(uint size, uint numVerti return NULL; else { - // check max vertex - if(numVertices > _MaxVerticesByVBHard) - return NULL; - // Create a CVertexBufferHardGL IVertexBufferHardGL *vbHard = NULL; // let the VAR create the vbhard.