From 932f2bdd27b99b046f34ddc8ce226004655863a0 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sun, 4 Aug 2013 02:33:37 +0200 Subject: [PATCH] Removed lots of Nvidia shader related code. --HG-- branch : gsoc2013-dfighter --- code/nel/src/3d/driver/OpenGL3/GL/glext.h | 134 ----------- .../src/3d/driver/OpenGL3/driver_opengl.cpp | 10 +- .../nel/src/3d/driver/OpenGL3/driver_opengl.h | 5 +- .../OpenGL3/driver_opengl_extension.cpp | 152 ------------- .../driver/OpenGL3/driver_opengl_extension.h | 73 ------ .../OpenGL3/driver_opengl_extension_def.h | 66 ------ .../driver/OpenGL3/driver_opengl_vertex.cpp | 147 +------------ .../OpenGL3/driver_opengl_vertex_program.cpp | 208 +----------------- 8 files changed, 19 insertions(+), 776 deletions(-) diff --git a/code/nel/src/3d/driver/OpenGL3/GL/glext.h b/code/nel/src/3d/driver/OpenGL3/GL/glext.h index 384c03731..677c84676 100644 --- a/code/nel/src/3d/driver/OpenGL3/GL/glext.h +++ b/code/nel/src/3d/driver/OpenGL3/GL/glext.h @@ -10196,140 +10196,6 @@ typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, G #define GL_NV_texture_shader2 1 #endif -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences); -GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id); -GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs); -GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params); -GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs); -GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program); -GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, GLvoid* *pointer); -GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id); -GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v); -GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v); -GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs); -GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform); -GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x); -GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x); -GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); -typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); -typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); -#endif - #ifndef GL_SGIX_texture_coordinate_clamp #define GL_SGIX_texture_coordinate_clamp 1 #endif diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp index 2456ee6b2..06152d02f 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp @@ -527,7 +527,7 @@ bool CDriverGL3::setupDisplay() checkForPerPixelLightingSupport(); // if EXTVertexShader is used, bind the standard GL arrays, and allocate constant - if (!_Extensions.NVVertexProgram && !_Extensions.ARBVertexProgram && _Extensions.EXTVertexShader) + if ( !_Extensions.ARBVertexProgram && _Extensions.EXTVertexShader) { _EVSPositionHandle = nglBindParameterEXT(GL_CURRENT_VERTEX_EXT); _EVSNormalHandle = nglBindParameterEXT(GL_CURRENT_NORMAL); @@ -1188,7 +1188,7 @@ void CDriverGL3::setupFog(float start, float end, CRGBA color) /** Special : with vertex program, using the extension EXT_vertex_shader, fog is emulated using 1 more constant to scale result to [0, 1] */ - if (_Extensions.EXTVertexShader && !_Extensions.NVVertexProgram && !_Extensions.ARBVertexProgram) + if (_Extensions.EXTVertexShader && !_Extensions.ARBVertexProgram) { if (!_ATIFogRangeFixed) { @@ -1323,7 +1323,7 @@ bool CDriverGL3::isWaterShaderSupported() const if(_Extensions.ARBFragmentProgram && ARBWaterShader[0] != 0) return true; - if (!_Extensions.EXTVertexShader && !_Extensions.NVVertexProgram && !_Extensions.ARBVertexProgram) return false; // should support vertex programs + if (!_Extensions.EXTVertexShader && !_Extensions.ARBVertexProgram) return false; // should support vertex programs if (!_Extensions.NVTextureShader && !_Extensions.ATIFragmentShader && !_Extensions.ARBFragmentProgram) return false; return true; } @@ -1389,12 +1389,12 @@ void CDriverGL3::checkForPerPixelLightingSupport() _SupportPerPixelShaderNoSpec = (_Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3) && _Extensions.ARBTextureCubeMap && _Extensions.NbTextureStages >= 3 - && (_Extensions.NVVertexProgram || _Extensions.ARBVertexProgram || _Extensions.EXTVertexShader); + && ( _Extensions.ARBVertexProgram || _Extensions.EXTVertexShader); _SupportPerPixelShader = (_Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3) && _Extensions.ARBTextureCubeMap && _Extensions.NbTextureStages >= 2 - && (_Extensions.NVVertexProgram || _Extensions.ARBVertexProgram || _Extensions.EXTVertexShader); + && ( _Extensions.ARBVertexProgram || _Extensions.EXTVertexShader); } // *************************************************************************** diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl.h index 820fe549a..5754db6aa 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl.h @@ -1170,10 +1170,8 @@ private: /// Tools fct used by setupGLArrays void setupGlArraysStd(CVertexBufferInfo &vb); - void setupGlArraysForNVVertexProgram(CVertexBufferInfo &vb); void setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb); void setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb); - void toggleGlArraysForNVVertexProgram(); void toggleGlArraysForARBVertexProgram(); void toggleGlArraysForEXTVertexShader(); @@ -1272,7 +1270,7 @@ private: // @{ bool isVertexProgramSupported () const; - bool isVertexProgramEmulated () const; + bool isVertexProgramEmulated () const{ return false; } bool activeVertexProgram (CVertexProgram *program); void setConstant (uint index, float, float, float, float); void setConstant (uint index, double, double, double, double); @@ -1292,7 +1290,6 @@ private: /// \name Vertex program implementation // @{ - bool activeNVVertexProgram (CVertexProgram *program); bool activeARBVertexProgram (CVertexProgram *program); bool activeEXTVertexShader (CVertexProgram *program); //@} 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 d32cf437f..be09e1638 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp @@ -115,71 +115,6 @@ NEL_PFNGLVERTEXWEIGHTFEXTPROC nglVertexWeightfEXT; NEL_PFNGLVERTEXWEIGHTFVEXTPROC nglVertexWeightfvEXT; NEL_PFNGLVERTEXWEIGHTPOINTEREXTPROC nglVertexWeightPointerEXT; -// VertexProgramExtension. -NEL_PFNGLAREPROGRAMSRESIDENTNVPROC nglAreProgramsResidentNV; -NEL_PFNGLBINDPROGRAMNVPROC nglBindProgramNV; -NEL_PFNGLDELETEPROGRAMSNVPROC nglDeleteProgramsNV; -NEL_PFNGLEXECUTEPROGRAMNVPROC nglExecuteProgramNV; -NEL_PFNGLGENPROGRAMSNVPROC nglGenProgramsNV; -NEL_PFNGLGETPROGRAMPARAMETERDVNVPROC nglGetProgramParameterdvNV; -NEL_PFNGLGETPROGRAMPARAMETERFVNVPROC nglGetProgramParameterfvNV; -NEL_PFNGLGETPROGRAMIVNVPROC nglGetProgramivNV; -NEL_PFNGLGETPROGRAMSTRINGNVPROC nglGetProgramStringNV; -NEL_PFNGLGETTRACKMATRIXIVNVPROC nglGetTrackMatrixivNV; -NEL_PFNGLGETVERTEXATTRIBDVNVPROC nglGetVertexAttribdvNV; -NEL_PFNGLGETVERTEXATTRIBFVNVPROC nglGetVertexAttribfvNV; -NEL_PFNGLGETVERTEXATTRIBIVNVPROC nglGetVertexAttribivNV; -NEL_PFNGLGETVERTEXATTRIBPOINTERVNVPROC nglGetVertexAttribPointervNV; -NEL_PFNGLISPROGRAMNVPROC nglIsProgramNV; -NEL_PFNGLLOADPROGRAMNVPROC nglLoadProgramNV; -NEL_PFNGLPROGRAMPARAMETER4DNVPROC nglProgramParameter4dNV; -NEL_PFNGLPROGRAMPARAMETER4DVNVPROC nglProgramParameter4dvNV; -NEL_PFNGLPROGRAMPARAMETER4FNVPROC nglProgramParameter4fNV; -NEL_PFNGLPROGRAMPARAMETER4FVNVPROC nglProgramParameter4fvNV; -NEL_PFNGLPROGRAMPARAMETERS4DVNVPROC nglProgramParameters4dvNV; -NEL_PFNGLPROGRAMPARAMETERS4FVNVPROC nglProgramParameters4fvNV; -NEL_PFNGLREQUESTRESIDENTPROGRAMSNVPROC nglRequestResidentProgramsNV; -NEL_PFNGLTRACKMATRIXNVPROC nglTrackMatrixNV; -NEL_PFNGLVERTEXATTRIBPOINTERNVPROC nglVertexAttribPointerNV; -NEL_PFNGLVERTEXATTRIB1DNVPROC nglVertexAttrib1dNV; -NEL_PFNGLVERTEXATTRIB1DVNVPROC nglVertexAttrib1dvNV; -NEL_PFNGLVERTEXATTRIB1FNVPROC nglVertexAttrib1fNV; -NEL_PFNGLVERTEXATTRIB1FVNVPROC nglVertexAttrib1fvNV; -NEL_PFNGLVERTEXATTRIB1SNVPROC nglVertexAttrib1sNV; -NEL_PFNGLVERTEXATTRIB1SVNVPROC nglVertexAttrib1svNV; -NEL_PFNGLVERTEXATTRIB2DNVPROC nglVertexAttrib2dNV; -NEL_PFNGLVERTEXATTRIB2DVNVPROC nglVertexAttrib2dvNV; -NEL_PFNGLVERTEXATTRIB2FNVPROC nglVertexAttrib2fNV; -NEL_PFNGLVERTEXATTRIB2FVNVPROC nglVertexAttrib2fvNV; -NEL_PFNGLVERTEXATTRIB2SNVPROC nglVertexAttrib2sNV; -NEL_PFNGLVERTEXATTRIB2SVNVPROC nglVertexAttrib2svNV; -NEL_PFNGLVERTEXATTRIB3DNVPROC nglVertexAttrib3dNV; -NEL_PFNGLVERTEXATTRIB3DVNVPROC nglVertexAttrib3dvNV; -NEL_PFNGLVERTEXATTRIB3FNVPROC nglVertexAttrib3fNV; -NEL_PFNGLVERTEXATTRIB3FVNVPROC nglVertexAttrib3fvNV; -NEL_PFNGLVERTEXATTRIB3SNVPROC nglVertexAttrib3sNV; -NEL_PFNGLVERTEXATTRIB3SVNVPROC nglVertexAttrib3svNV; -NEL_PFNGLVERTEXATTRIB4DNVPROC nglVertexAttrib4dNV; -NEL_PFNGLVERTEXATTRIB4DVNVPROC nglVertexAttrib4dvNV; -NEL_PFNGLVERTEXATTRIB4FNVPROC nglVertexAttrib4fNV; -NEL_PFNGLVERTEXATTRIB4FVNVPROC nglVertexAttrib4fvNV; -NEL_PFNGLVERTEXATTRIB4SNVPROC nglVertexAttrib4sNV; -NEL_PFNGLVERTEXATTRIB4SVNVPROC nglVertexAttrib4svNV; -NEL_PFNGLVERTEXATTRIB4UBVNVPROC nglVertexAttrib4ubvNV; -NEL_PFNGLVERTEXATTRIBS1DVNVPROC nglVertexAttribs1dvNV; -NEL_PFNGLVERTEXATTRIBS1FVNVPROC nglVertexAttribs1fvNV; -NEL_PFNGLVERTEXATTRIBS1SVNVPROC nglVertexAttribs1svNV; -NEL_PFNGLVERTEXATTRIBS2DVNVPROC nglVertexAttribs2dvNV; -NEL_PFNGLVERTEXATTRIBS2FVNVPROC nglVertexAttribs2fvNV; -NEL_PFNGLVERTEXATTRIBS2SVNVPROC nglVertexAttribs2svNV; -NEL_PFNGLVERTEXATTRIBS3DVNVPROC nglVertexAttribs3dvNV; -NEL_PFNGLVERTEXATTRIBS3FVNVPROC nglVertexAttribs3fvNV; -NEL_PFNGLVERTEXATTRIBS3SVNVPROC nglVertexAttribs3svNV; -NEL_PFNGLVERTEXATTRIBS4DVNVPROC nglVertexAttribs4dvNV; -NEL_PFNGLVERTEXATTRIBS4FVNVPROC nglVertexAttribs4fvNV; -NEL_PFNGLVERTEXATTRIBS4SVNVPROC nglVertexAttribs4svNV; -NEL_PFNGLVERTEXATTRIBS4UBVNVPROC nglVertexAttribs4ubvNV; - // VertexShaderExt extension NEL_PFNGLBEGINVERTEXSHADEREXTPROC nglBeginVertexShaderEXT; NEL_PFNGLENDVERTEXSHADEREXTPROC nglEndVertexShaderEXT; @@ -658,87 +593,6 @@ static bool setupARBTextureCubeMap(const char *glext) } -// ********************************* -static bool setupNVVertexProgram(const char *glext) -{ - H_AUTO_OGL(setupNVVertexProgram); - -// reenabled to allow bloom on mac, TODO: cleanly fix the water issue -// i think this issue was mtp target related - is this the case in ryzom too? -// #ifdef NL_OS_MAC -// // Water doesn't render on GeForce 8600M GT (on MAC OS X) if this extension is enabled -// return false; -// #endif - - CHECK_EXT("GL_NV_vertex_program"); - - CHECK_ADDRESS(NEL_PFNGLAREPROGRAMSRESIDENTNVPROC, glAreProgramsResidentNV); - CHECK_ADDRESS(NEL_PFNGLBINDPROGRAMNVPROC, glBindProgramNV); - CHECK_ADDRESS(NEL_PFNGLDELETEPROGRAMSNVPROC, glDeleteProgramsNV); - CHECK_ADDRESS(NEL_PFNGLEXECUTEPROGRAMNVPROC, glExecuteProgramNV); - CHECK_ADDRESS(NEL_PFNGLGENPROGRAMSNVPROC, glGenProgramsNV); - CHECK_ADDRESS(NEL_PFNGLGETPROGRAMPARAMETERDVNVPROC, glGetProgramParameterdvNV); - CHECK_ADDRESS(NEL_PFNGLGETPROGRAMPARAMETERFVNVPROC, glGetProgramParameterfvNV); - CHECK_ADDRESS(NEL_PFNGLGETPROGRAMIVNVPROC, glGetProgramivNV); - CHECK_ADDRESS(NEL_PFNGLGETPROGRAMSTRINGNVPROC, glGetProgramStringNV); - CHECK_ADDRESS(NEL_PFNGLGETTRACKMATRIXIVNVPROC, glGetTrackMatrixivNV); - CHECK_ADDRESS(NEL_PFNGLGETVERTEXATTRIBDVNVPROC, glGetVertexAttribdvNV); - CHECK_ADDRESS(NEL_PFNGLGETVERTEXATTRIBFVNVPROC, glGetVertexAttribfvNV); - CHECK_ADDRESS(NEL_PFNGLGETVERTEXATTRIBIVNVPROC, glGetVertexAttribivNV); - CHECK_ADDRESS(NEL_PFNGLGETVERTEXATTRIBPOINTERVNVPROC, glGetVertexAttribPointervNV); - CHECK_ADDRESS(NEL_PFNGLISPROGRAMNVPROC, glIsProgramNV); - CHECK_ADDRESS(NEL_PFNGLLOADPROGRAMNVPROC, glLoadProgramNV); - CHECK_ADDRESS(NEL_PFNGLPROGRAMPARAMETER4DNVPROC, glProgramParameter4dNV); - CHECK_ADDRESS(NEL_PFNGLPROGRAMPARAMETER4DVNVPROC, glProgramParameter4dvNV); - CHECK_ADDRESS(NEL_PFNGLPROGRAMPARAMETER4FNVPROC, glProgramParameter4fNV); - CHECK_ADDRESS(NEL_PFNGLPROGRAMPARAMETER4FVNVPROC, glProgramParameter4fvNV); - CHECK_ADDRESS(NEL_PFNGLPROGRAMPARAMETERS4DVNVPROC, glProgramParameters4dvNV); - CHECK_ADDRESS(NEL_PFNGLPROGRAMPARAMETERS4FVNVPROC, glProgramParameters4fvNV); - CHECK_ADDRESS(NEL_PFNGLREQUESTRESIDENTPROGRAMSNVPROC, glRequestResidentProgramsNV); - CHECK_ADDRESS(NEL_PFNGLTRACKMATRIXNVPROC, glTrackMatrixNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBPOINTERNVPROC, glVertexAttribPointerNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB1DNVPROC, glVertexAttrib1dNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB1DVNVPROC, glVertexAttrib1dvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB1FNVPROC, glVertexAttrib1fNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB1FVNVPROC, glVertexAttrib1fvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB1SNVPROC, glVertexAttrib1sNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB1SVNVPROC, glVertexAttrib1svNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB2DNVPROC, glVertexAttrib2dNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB2DVNVPROC, glVertexAttrib2dvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB2FNVPROC, glVertexAttrib2fNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB2FVNVPROC, glVertexAttrib2fvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB2SNVPROC, glVertexAttrib2sNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB2SVNVPROC, glVertexAttrib2svNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB3DNVPROC, glVertexAttrib3dNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB3DVNVPROC, glVertexAttrib3dvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB3FNVPROC, glVertexAttrib3fNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB3FVNVPROC, glVertexAttrib3fvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB3SNVPROC, glVertexAttrib3sNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB3SVNVPROC, glVertexAttrib3svNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB4DNVPROC, glVertexAttrib4dNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB4DVNVPROC, glVertexAttrib4dvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB4FNVPROC, glVertexAttrib4fNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB4FVNVPROC, glVertexAttrib4fvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB4SNVPROC, glVertexAttrib4sNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB4SVNVPROC, glVertexAttrib4svNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIB4UBVNVPROC, glVertexAttrib4ubvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS1DVNVPROC, glVertexAttribs1dvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS1FVNVPROC, glVertexAttribs1fvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS1SVNVPROC, glVertexAttribs1svNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS2DVNVPROC, glVertexAttribs2dvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS2FVNVPROC, glVertexAttribs2fvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS2SVNVPROC, glVertexAttribs2svNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS3DVNVPROC, glVertexAttribs3dvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS3FVNVPROC, glVertexAttribs3fvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS3SVNVPROC, glVertexAttribs3svNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS4DVNVPROC, glVertexAttribs4dvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS4FVNVPROC, glVertexAttribs4fvNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS4SVNVPROC, glVertexAttribs4svNV); - CHECK_ADDRESS(NEL_PFNGLVERTEXATTRIBS4UBVNVPROC, glVertexAttribs4ubvNV); - - return true; -} - // ********************************* static bool setupEXTVertexShader(const char *glext) { @@ -1239,13 +1093,11 @@ void registerGlExtensions(CGlExtensions &ext) // Disable feature ??? if(!ext.DisableHardwareVertexProgram) { - ext.NVVertexProgram = setupNVVertexProgram(glext); ext.EXTVertexShader = setupEXTVertexShader(glext); ext.ARBVertexProgram= setupARBVertexProgram(glext); } else { - ext.NVVertexProgram = false; ext.EXTVertexShader = false; ext.ARBVertexProgram = false; } @@ -1270,10 +1122,6 @@ void registerGlExtensions(CGlExtensions &ext) ext.ARBFragmentProgram = false; } - // For now, the only way to know if emulation, is to test some extension which exist only on GeForce3. - // if GL_NV_texture_shader is not here, then we are not on GeForce3. - ext.NVVertexProgramEmulated= ext.NVVertexProgram && (strstr(glext, "GL_NV_texture_shader")==NULL); - // Check EXTSecondaryColor ext.EXTSecondaryColor= setupEXTSecondaryColor(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 d684e0741..f31238e3d 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h @@ -47,7 +47,6 @@ struct CGlExtensions bool EXTSeparateSpecularColor; bool NVTextureEnvCombine4; bool ARBTextureCubeMap; - bool NVVertexProgram; bool EXTVertexShader; bool NVTextureShader; bool NVOcclusionQuery; @@ -61,8 +60,6 @@ struct CGlExtensions bool EXTTextureFilterAnisotropic; float EXTTextureFilterAnisotropicMaximum; - // true if NVVertexProgram and if we know that VP is emulated - bool NVVertexProgramEmulated; bool EXTSecondaryColor; bool EXTBlendColor; // equal to GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV if possible, or GL_VERTEX_ARRAY_RANGE_NV @@ -120,8 +117,6 @@ public: ATIXTextureEnvRoute= false; ARBTextureCubeMap= false; NVTextureShader= false; - NVVertexProgram= false; - NVVertexProgramEmulated= false; EXTSecondaryColor= false; WGLARBPBuffer= false; WGLARBPixelFormat= false; @@ -187,9 +182,7 @@ public: result += ATIFragmentShader ? "ATIFragmentShader " : ""; result += ARBFragmentProgram ? "ARBFragmentProgram " : ""; result += ARBVertexProgram ? "ARBVertexProgram " : ""; - result += NVVertexProgram ? "NVVertexProgram " : ""; result += EXTVertexShader ? "EXTVertexShader " : ""; - result += NVVertexProgramEmulated ? "NVVertexProgramEmulated " : ""; result += "\n Misc: "; result += EXTVertexWeighting ? "EXTVertexWeighting " : ""; @@ -315,72 +308,6 @@ extern NEL_PFNGLVERTEXWEIGHTFVEXTPROC nglVertexWeightfvEXT; extern NEL_PFNGLVERTEXWEIGHTPOINTEREXTPROC nglVertexWeightPointerEXT; -// VertexProgramExtension. -//======================== -extern NEL_PFNGLAREPROGRAMSRESIDENTNVPROC nglAreProgramsResidentNV; -extern NEL_PFNGLBINDPROGRAMNVPROC nglBindProgramNV; -extern NEL_PFNGLDELETEPROGRAMSNVPROC nglDeleteProgramsNV; -extern NEL_PFNGLEXECUTEPROGRAMNVPROC nglExecuteProgramNV; -extern NEL_PFNGLGENPROGRAMSNVPROC nglGenProgramsNV; -extern NEL_PFNGLGETPROGRAMPARAMETERDVNVPROC nglGetProgramParameterdvNV; -extern NEL_PFNGLGETPROGRAMPARAMETERFVNVPROC nglGetProgramParameterfvNV; -extern NEL_PFNGLGETPROGRAMIVNVPROC nglGetProgramivNV; -extern NEL_PFNGLGETPROGRAMSTRINGNVPROC nglGetProgramStringNV; -extern NEL_PFNGLGETTRACKMATRIXIVNVPROC nglGetTrackMatrixivNV; -extern NEL_PFNGLGETVERTEXATTRIBDVNVPROC nglGetVertexAttribdvNV; -extern NEL_PFNGLGETVERTEXATTRIBFVNVPROC nglGetVertexAttribfvNV; -extern NEL_PFNGLGETVERTEXATTRIBIVNVPROC nglGetVertexAttribivNV; -extern NEL_PFNGLGETVERTEXATTRIBPOINTERVNVPROC nglGetVertexAttribPointervNV; -extern NEL_PFNGLISPROGRAMNVPROC nglIsProgramNV; -extern NEL_PFNGLLOADPROGRAMNVPROC nglLoadProgramNV; -extern NEL_PFNGLPROGRAMPARAMETER4DNVPROC nglProgramParameter4dNV; -extern NEL_PFNGLPROGRAMPARAMETER4DVNVPROC nglProgramParameter4dvNV; -extern NEL_PFNGLPROGRAMPARAMETER4FNVPROC nglProgramParameter4fNV; -extern NEL_PFNGLPROGRAMPARAMETER4FVNVPROC nglProgramParameter4fvNV; -extern NEL_PFNGLPROGRAMPARAMETERS4DVNVPROC nglProgramParameters4dvNV; -extern NEL_PFNGLPROGRAMPARAMETERS4FVNVPROC nglProgramParameters4fvNV; -extern NEL_PFNGLREQUESTRESIDENTPROGRAMSNVPROC nglRequestResidentProgramsNV; -extern NEL_PFNGLTRACKMATRIXNVPROC nglTrackMatrixNV; -extern NEL_PFNGLVERTEXATTRIBPOINTERNVPROC nglVertexAttribPointerNV; -extern NEL_PFNGLVERTEXATTRIB1DNVPROC nglVertexAttrib1dNV; -extern NEL_PFNGLVERTEXATTRIB1DVNVPROC nglVertexAttrib1dvNV; -extern NEL_PFNGLVERTEXATTRIB1FNVPROC nglVertexAttrib1fNV; -extern NEL_PFNGLVERTEXATTRIB1FVNVPROC nglVertexAttrib1fvNV; -extern NEL_PFNGLVERTEXATTRIB1SNVPROC nglVertexAttrib1sNV; -extern NEL_PFNGLVERTEXATTRIB1SVNVPROC nglVertexAttrib1svNV; -extern NEL_PFNGLVERTEXATTRIB2DNVPROC nglVertexAttrib2dNV; -extern NEL_PFNGLVERTEXATTRIB2DVNVPROC nglVertexAttrib2dvNV; -extern NEL_PFNGLVERTEXATTRIB2FNVPROC nglVertexAttrib2fNV; -extern NEL_PFNGLVERTEXATTRIB2FVNVPROC nglVertexAttrib2fvNV; -extern NEL_PFNGLVERTEXATTRIB2SNVPROC nglVertexAttrib2sNV; -extern NEL_PFNGLVERTEXATTRIB2SVNVPROC nglVertexAttrib2svNV; -extern NEL_PFNGLVERTEXATTRIB3DNVPROC nglVertexAttrib3dNV; -extern NEL_PFNGLVERTEXATTRIB3DVNVPROC nglVertexAttrib3dvNV; -extern NEL_PFNGLVERTEXATTRIB3FNVPROC nglVertexAttrib3fNV; -extern NEL_PFNGLVERTEXATTRIB3FVNVPROC nglVertexAttrib3fvNV; -extern NEL_PFNGLVERTEXATTRIB3SNVPROC nglVertexAttrib3sNV; -extern NEL_PFNGLVERTEXATTRIB3SVNVPROC nglVertexAttrib3svNV; -extern NEL_PFNGLVERTEXATTRIB4DNVPROC nglVertexAttrib4dNV; -extern NEL_PFNGLVERTEXATTRIB4DVNVPROC nglVertexAttrib4dvNV; -extern NEL_PFNGLVERTEXATTRIB4FNVPROC nglVertexAttrib4fNV; -extern NEL_PFNGLVERTEXATTRIB4FVNVPROC nglVertexAttrib4fvNV; -extern NEL_PFNGLVERTEXATTRIB4SNVPROC nglVertexAttrib4sNV; -extern NEL_PFNGLVERTEXATTRIB4SVNVPROC nglVertexAttrib4svNV; -extern NEL_PFNGLVERTEXATTRIB4UBVNVPROC nglVertexAttrib4ubvNV; -extern NEL_PFNGLVERTEXATTRIBS1DVNVPROC nglVertexAttribs1dvNV; -extern NEL_PFNGLVERTEXATTRIBS1FVNVPROC nglVertexAttribs1fvNV; -extern NEL_PFNGLVERTEXATTRIBS1SVNVPROC nglVertexAttribs1svNV; -extern NEL_PFNGLVERTEXATTRIBS2DVNVPROC nglVertexAttribs2dvNV; -extern NEL_PFNGLVERTEXATTRIBS2FVNVPROC nglVertexAttribs2fvNV; -extern NEL_PFNGLVERTEXATTRIBS2SVNVPROC nglVertexAttribs2svNV; -extern NEL_PFNGLVERTEXATTRIBS3DVNVPROC nglVertexAttribs3dvNV; -extern NEL_PFNGLVERTEXATTRIBS3FVNVPROC nglVertexAttribs3fvNV; -extern NEL_PFNGLVERTEXATTRIBS3SVNVPROC nglVertexAttribs3svNV; -extern NEL_PFNGLVERTEXATTRIBS4DVNVPROC nglVertexAttribs4dvNV; -extern NEL_PFNGLVERTEXATTRIBS4FVNVPROC nglVertexAttribs4fvNV; -extern NEL_PFNGLVERTEXATTRIBS4SVNVPROC nglVertexAttribs4svNV; -extern NEL_PFNGLVERTEXATTRIBS4UBVNVPROC nglVertexAttribs4ubvNV; - // VertexShaderExtension. //======================== extern NEL_PFNGLBEGINVERTEXSHADEREXTPROC nglBeginVertexShaderEXT; diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension_def.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension_def.h index 50f255375..2919e865f 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension_def.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension_def.h @@ -91,72 +91,6 @@ typedef void (APIENTRY * NEL_PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight) typedef void (APIENTRY * NEL_PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); -// VertexProgramExtension. -//======================== -typedef GLboolean (APIENTRY * NEL_PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); -typedef void (APIENTRY * NEL_PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRY * NEL_PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRY * NEL_PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); -typedef void (APIENTRY * NEL_PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRY * NEL_PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRY * NEL_PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRY * NEL_PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRY * NEL_PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); -typedef void (APIENTRY * NEL_PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); -typedef void (APIENTRY * NEL_PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRY * NEL_PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRY * NEL_PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRY * NEL_PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRY * NEL_PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (APIENTRY * NEL_PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -typedef void (APIENTRY * NEL_PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * NEL_PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); -typedef void (APIENTRY * NEL_PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * NEL_PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); -typedef void (APIENTRY * NEL_PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRY * NEL_PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRY * NEL_PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRY * NEL_PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRY * NEL_PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); - // VertexShaderExtension (EXT) //============================ typedef void (APIENTRY * NEL_PFNGLBEGINVERTEXSHADEREXTPROC) ( void ); 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 015b74e8c..e9148624e 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp @@ -861,49 +861,6 @@ void CDriverGL3::setupGlArraysStd(CVertexBufferInfo &vb) } -// *************************************************************************** -void CDriverGL3::toggleGlArraysForNVVertexProgram() -{ - H_AUTO_OGL(CDriverGL3_toggleGlArraysForNVVertexProgram) - // If change of setup type, must disable olds. - //======================= - - // If last was a VertexProgram setup, and now it is a standard GL array setup. - if( _LastSetupGLArrayVertexProgram && !isVertexProgramEnabled () ) - { - - // Disable all VertexAttribs. - for (uint value=0; value_Extensions.NVVertexProgram - || drv->_Extensions.EXTVertexShader + nlassert (drv->_Extensions.EXTVertexShader || drv->_Extensions.ARBVertexProgram ); - if (drv->_Extensions.NVVertexProgram) // NVIDIA implemntation - { - // Generate a program - nglGenProgramsNV (1, &ID); - } - else if (drv->_Extensions.ARBVertexProgram) // ARB implementation + if (drv->_Extensions.ARBVertexProgram) // ARB implementation { nglGenProgramsARB(1, &ID); } @@ -67,133 +61,7 @@ CVertexProgamDrvInfosGL3::CVertexProgamDrvInfosGL3 (CDriverGL3 *drv, ItVtxPrgDrv bool CDriverGL3::isVertexProgramSupported () const { H_AUTO_OGL(CVertexProgamDrvInfosGL_isVertexProgramSupported) - return _Extensions.NVVertexProgram || _Extensions.EXTVertexShader || _Extensions.ARBVertexProgram; -} - -// *************************************************************************** -bool CDriverGL3::isVertexProgramEmulated () const -{ - H_AUTO_OGL(CVertexProgamDrvInfosGL_isVertexProgramEmulated) - return _Extensions.NVVertexProgramEmulated; -} - - - -// *************************************************************************** -bool CDriverGL3::activeNVVertexProgram (CVertexProgram *program) -{ - H_AUTO_OGL(CVertexProgamDrvInfosGL_activeNVVertexProgram); - - // Setup or unsetup ? - if (program) - { - // Enable vertex program - glEnable (GL_VERTEX_PROGRAM_NV); - _VertexProgramEnabled= true; - - - // Driver info - CVertexProgamDrvInfosGL3 *drvInfo; - - // Program setuped ? - if (program->_DrvInfo==NULL) - { - /** Check with our parser if the program will works with other implemented extensions, too. (EXT_vertex_shader ..). - * There are some incompatibilities. - */ - CVPParser parser; - CVPParser::TProgram parsedProgram; - std::string errorOutput; - bool result = parser.parse(program->getProgram().c_str(), parsedProgram, errorOutput); - if (!result) - { - nlwarning("Unable to parse a vertex program :"); - nlwarning(errorOutput.c_str()); - #ifdef NL_DEBUG - nlassert(0); - #endif - return false; - } - - // Insert into driver list. (so it is deleted when driver is deleted). - ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); - - // Create a driver info - *it = drvInfo = new CVertexProgamDrvInfosGL3 (this, it); - - // Set the pointer - program->_DrvInfo=drvInfo; - - // Compile the program - nglLoadProgramNV (GL_VERTEX_PROGRAM_NV, drvInfo->ID, (GLsizei)program->getProgram().length(), (const GLubyte*)program->getProgram().c_str()); - - // Get loading error code - GLint errorOff; - glGetIntegerv (GL_PROGRAM_ERROR_POSITION_NV, &errorOff); - - // Compilation error ? - if (errorOff>=0) - { - // String length - uint length = (uint)program->getProgram ().length(); - const char* sString= program->getProgram ().c_str(); - - // Line count and char count - uint line=1; - uint charC=1; - - // Find the line - uint offset=0; - while ((offset((IVertexProgramDrvInfos*)program->_DrvInfo); - } - - // Setup this program - nglBindProgramNV (GL_VERTEX_PROGRAM_NV, drvInfo->ID); - _LastSetuppedVP = program; - - // Ok - return true; - } - else // Unsetup - { - // Disable vertex program - glDisable (GL_VERTEX_PROGRAM_NV); - _VertexProgramEnabled= false; - // Ok - return true; - } - return false; + return _Extensions.EXTVertexShader || _Extensions.ARBVertexProgram; } // *************************************************************************** @@ -1612,11 +1480,7 @@ bool CDriverGL3::activeVertexProgram (CVertexProgram *program) { H_AUTO_OGL(CDriverGL3_activeVertexProgram) // Extension here ? - if (_Extensions.NVVertexProgram) - { - return activeNVVertexProgram(program); - } - else if (_Extensions.ARBVertexProgram) + if (_Extensions.ARBVertexProgram) { return activeARBVertexProgram(program); } @@ -1637,12 +1501,7 @@ void CDriverGL3::setConstant (uint index, float f0, float f1, float f2, float f3 H_AUTO_OGL(CDriverGL3_setConstant); // Vertex program exist ? - if (_Extensions.NVVertexProgram) - { - // Setup constant - nglProgramParameter4fNV (GL_VERTEX_PROGRAM_NV, index, f0, f1, f2, f3); - } - else if (_Extensions.ARBVertexProgram) + if (_Extensions.ARBVertexProgram) { nglProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB, index, f0, f1, f2, f3); } @@ -1661,12 +1520,7 @@ void CDriverGL3::setConstant (uint index, double d0, double d1, double d2, doubl H_AUTO_OGL(CDriverGL3_setConstant); // Vertex program exist ? - if (_Extensions.NVVertexProgram) - { - // Setup constant - nglProgramParameter4dNV (GL_VERTEX_PROGRAM_NV, index, d0, d1, d2, d3); - } - else if (_Extensions.ARBVertexProgram) + if (_Extensions.ARBVertexProgram) { nglProgramEnvParameter4dARB(GL_VERTEX_PROGRAM_ARB, index, d0, d1, d2, d3); } @@ -1685,12 +1539,7 @@ void CDriverGL3::setConstant (uint index, const NLMISC::CVector& value) H_AUTO_OGL(CDriverGL3_setConstant); // Vertex program exist ? - if (_Extensions.NVVertexProgram) - { - // Setup constant - nglProgramParameter4fNV (GL_VERTEX_PROGRAM_NV, index, value.x, value.y, value.z, 0); - } - else if (_Extensions.ARBVertexProgram) + if (_Extensions.ARBVertexProgram) { nglProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB, index, value.x, value.y, value.z, 0); } @@ -1709,12 +1558,7 @@ void CDriverGL3::setConstant (uint index, const NLMISC::CVectorD& value) H_AUTO_OGL(CDriverGL3_setConstant); // Vertex program exist ? - if (_Extensions.NVVertexProgram) - { - // Setup constant - nglProgramParameter4dNV (GL_VERTEX_PROGRAM_NV, index, value.x, value.y, value.z, 0); - } - else if (_Extensions.ARBVertexProgram) + if (_Extensions.ARBVertexProgram) { nglProgramEnvParameter4dARB(GL_VERTEX_PROGRAM_ARB, index, value.x, value.y, value.z, 0); } @@ -1732,11 +1576,7 @@ void CDriverGL3::setConstant (uint index, uint num, const float *src) H_AUTO_OGL(CDriverGL3_setConstant); // Vertex program exist ? - if (_Extensions.NVVertexProgram) - { - nglProgramParameters4fvNV(GL_VERTEX_PROGRAM_NV, index, num, src); - } - else if (_Extensions.ARBVertexProgram) + if (_Extensions.ARBVertexProgram) { for(uint k = 0; k < num; ++k) { @@ -1758,11 +1598,7 @@ void CDriverGL3::setConstant (uint index, uint num, const double *src) H_AUTO_OGL(CDriverGL3_setConstant); // Vertex program exist ? - if (_Extensions.NVVertexProgram) - { - nglProgramParameters4dvNV(GL_VERTEX_PROGRAM_NV, index, num, src); - } - else if (_Extensions.ARBVertexProgram) + if (_Extensions.ARBVertexProgram) { for(uint k = 0; k < num; ++k) { @@ -1805,18 +1641,6 @@ void CDriverGL3::setConstantMatrix (uint index, IDriver::TMatrix matrix, IDriver { H_AUTO_OGL(CDriverGL3_setConstantMatrix); - // Vertex program exist ? - if (_Extensions.NVVertexProgram) - { - // First, ensure that the render setup is correclty setuped. - refreshRenderSetup(); - - // Track the matrix - nglTrackMatrixNV (GL_VERTEX_PROGRAM_NV, index, GLMatrix[matrix], GLTransform[transform]); - // Release Track => matrix data is copied. - nglTrackMatrixNV (GL_VERTEX_PROGRAM_NV, index, GL_NONE, GL_IDENTITY_NV); - } - else { // First, ensure that the render setup is correctly setuped. refreshRenderSetup(); @@ -1890,15 +1714,7 @@ void CDriverGL3::enableVertexProgramDoubleSidedColor(bool doubleSided) H_AUTO_OGL(CDriverGL3_enableVertexProgramDoubleSidedColor); // Vertex program exist ? - if (_Extensions.NVVertexProgram) - { - // change mode (not cached because supposed to be rare) - if(doubleSided) - glEnable (GL_VERTEX_PROGRAM_TWO_SIDE_NV); - else - glDisable (GL_VERTEX_PROGRAM_TWO_SIDE_NV); - } - else if (_Extensions.ARBVertexProgram) + if (_Extensions.ARBVertexProgram) { // change mode (not cached because supposed to be rare) if(doubleSided) @@ -1914,7 +1730,7 @@ bool CDriverGL3::supportVertexProgramDoubleSidedColor() const { H_AUTO_OGL(CDriverGL3_supportVertexProgramDoubleSidedColor) // currently only supported by NV_VERTEX_PROGRAM && ARB_VERTEX_PROGRAM - return _Extensions.NVVertexProgram || _Extensions.ARBVertexProgram; + return _Extensions.ARBVertexProgram; } #ifdef NL_STATIC