Removed lots of Nvidia shader related code.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 11 years ago
parent f925666d83
commit 932f2bdd27

@ -10196,140 +10196,6 @@ typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, G
#define GL_NV_texture_shader2 1 #define GL_NV_texture_shader2 1
#endif #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 #ifndef GL_SGIX_texture_coordinate_clamp
#define GL_SGIX_texture_coordinate_clamp 1 #define GL_SGIX_texture_coordinate_clamp 1
#endif #endif

@ -527,7 +527,7 @@ bool CDriverGL3::setupDisplay()
checkForPerPixelLightingSupport(); checkForPerPixelLightingSupport();
// if EXTVertexShader is used, bind the standard GL arrays, and allocate constant // 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); _EVSPositionHandle = nglBindParameterEXT(GL_CURRENT_VERTEX_EXT);
_EVSNormalHandle = nglBindParameterEXT(GL_CURRENT_NORMAL); _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] /** 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) if (!_ATIFogRangeFixed)
{ {
@ -1323,7 +1323,7 @@ bool CDriverGL3::isWaterShaderSupported() const
if(_Extensions.ARBFragmentProgram && ARBWaterShader[0] != 0) return true; 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; if (!_Extensions.NVTextureShader && !_Extensions.ATIFragmentShader && !_Extensions.ARBFragmentProgram) return false;
return true; return true;
} }
@ -1389,12 +1389,12 @@ void CDriverGL3::checkForPerPixelLightingSupport()
_SupportPerPixelShaderNoSpec = (_Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3) _SupportPerPixelShaderNoSpec = (_Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3)
&& _Extensions.ARBTextureCubeMap && _Extensions.ARBTextureCubeMap
&& _Extensions.NbTextureStages >= 3 && _Extensions.NbTextureStages >= 3
&& (_Extensions.NVVertexProgram || _Extensions.ARBVertexProgram || _Extensions.EXTVertexShader); && ( _Extensions.ARBVertexProgram || _Extensions.EXTVertexShader);
_SupportPerPixelShader = (_Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3) _SupportPerPixelShader = (_Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3)
&& _Extensions.ARBTextureCubeMap && _Extensions.ARBTextureCubeMap
&& _Extensions.NbTextureStages >= 2 && _Extensions.NbTextureStages >= 2
&& (_Extensions.NVVertexProgram || _Extensions.ARBVertexProgram || _Extensions.EXTVertexShader); && ( _Extensions.ARBVertexProgram || _Extensions.EXTVertexShader);
} }
// *************************************************************************** // ***************************************************************************

@ -1170,10 +1170,8 @@ private:
/// Tools fct used by setupGLArrays /// Tools fct used by setupGLArrays
void setupGlArraysStd(CVertexBufferInfo &vb); void setupGlArraysStd(CVertexBufferInfo &vb);
void setupGlArraysForNVVertexProgram(CVertexBufferInfo &vb);
void setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb); void setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb);
void setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb); void setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb);
void toggleGlArraysForNVVertexProgram();
void toggleGlArraysForARBVertexProgram(); void toggleGlArraysForARBVertexProgram();
void toggleGlArraysForEXTVertexShader(); void toggleGlArraysForEXTVertexShader();
@ -1272,7 +1270,7 @@ private:
// @{ // @{
bool isVertexProgramSupported () const; bool isVertexProgramSupported () const;
bool isVertexProgramEmulated () const; bool isVertexProgramEmulated () const{ return false; }
bool activeVertexProgram (CVertexProgram *program); bool activeVertexProgram (CVertexProgram *program);
void setConstant (uint index, float, float, float, float); void setConstant (uint index, float, float, float, float);
void setConstant (uint index, double, double, double, double); void setConstant (uint index, double, double, double, double);
@ -1292,7 +1290,6 @@ private:
/// \name Vertex program implementation /// \name Vertex program implementation
// @{ // @{
bool activeNVVertexProgram (CVertexProgram *program);
bool activeARBVertexProgram (CVertexProgram *program); bool activeARBVertexProgram (CVertexProgram *program);
bool activeEXTVertexShader (CVertexProgram *program); bool activeEXTVertexShader (CVertexProgram *program);
//@} //@}

@ -115,71 +115,6 @@ NEL_PFNGLVERTEXWEIGHTFEXTPROC nglVertexWeightfEXT;
NEL_PFNGLVERTEXWEIGHTFVEXTPROC nglVertexWeightfvEXT; NEL_PFNGLVERTEXWEIGHTFVEXTPROC nglVertexWeightfvEXT;
NEL_PFNGLVERTEXWEIGHTPOINTEREXTPROC nglVertexWeightPointerEXT; 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 // VertexShaderExt extension
NEL_PFNGLBEGINVERTEXSHADEREXTPROC nglBeginVertexShaderEXT; NEL_PFNGLBEGINVERTEXSHADEREXTPROC nglBeginVertexShaderEXT;
NEL_PFNGLENDVERTEXSHADEREXTPROC nglEndVertexShaderEXT; 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) static bool setupEXTVertexShader(const char *glext)
{ {
@ -1239,13 +1093,11 @@ void registerGlExtensions(CGlExtensions &ext)
// Disable feature ??? // Disable feature ???
if(!ext.DisableHardwareVertexProgram) if(!ext.DisableHardwareVertexProgram)
{ {
ext.NVVertexProgram = setupNVVertexProgram(glext);
ext.EXTVertexShader = setupEXTVertexShader(glext); ext.EXTVertexShader = setupEXTVertexShader(glext);
ext.ARBVertexProgram= setupARBVertexProgram(glext); ext.ARBVertexProgram= setupARBVertexProgram(glext);
} }
else else
{ {
ext.NVVertexProgram = false;
ext.EXTVertexShader = false; ext.EXTVertexShader = false;
ext.ARBVertexProgram = false; ext.ARBVertexProgram = false;
} }
@ -1270,10 +1122,6 @@ void registerGlExtensions(CGlExtensions &ext)
ext.ARBFragmentProgram = false; 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 // Check EXTSecondaryColor
ext.EXTSecondaryColor= setupEXTSecondaryColor(glext); ext.EXTSecondaryColor= setupEXTSecondaryColor(glext);

@ -47,7 +47,6 @@ struct CGlExtensions
bool EXTSeparateSpecularColor; bool EXTSeparateSpecularColor;
bool NVTextureEnvCombine4; bool NVTextureEnvCombine4;
bool ARBTextureCubeMap; bool ARBTextureCubeMap;
bool NVVertexProgram;
bool EXTVertexShader; bool EXTVertexShader;
bool NVTextureShader; bool NVTextureShader;
bool NVOcclusionQuery; bool NVOcclusionQuery;
@ -61,8 +60,6 @@ struct CGlExtensions
bool EXTTextureFilterAnisotropic; bool EXTTextureFilterAnisotropic;
float EXTTextureFilterAnisotropicMaximum; float EXTTextureFilterAnisotropicMaximum;
// true if NVVertexProgram and if we know that VP is emulated
bool NVVertexProgramEmulated;
bool EXTSecondaryColor; bool EXTSecondaryColor;
bool EXTBlendColor; bool EXTBlendColor;
// equal to GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV if possible, or GL_VERTEX_ARRAY_RANGE_NV // equal to GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV if possible, or GL_VERTEX_ARRAY_RANGE_NV
@ -120,8 +117,6 @@ public:
ATIXTextureEnvRoute= false; ATIXTextureEnvRoute= false;
ARBTextureCubeMap= false; ARBTextureCubeMap= false;
NVTextureShader= false; NVTextureShader= false;
NVVertexProgram= false;
NVVertexProgramEmulated= false;
EXTSecondaryColor= false; EXTSecondaryColor= false;
WGLARBPBuffer= false; WGLARBPBuffer= false;
WGLARBPixelFormat= false; WGLARBPixelFormat= false;
@ -187,9 +182,7 @@ public:
result += ATIFragmentShader ? "ATIFragmentShader " : ""; result += ATIFragmentShader ? "ATIFragmentShader " : "";
result += ARBFragmentProgram ? "ARBFragmentProgram " : ""; result += ARBFragmentProgram ? "ARBFragmentProgram " : "";
result += ARBVertexProgram ? "ARBVertexProgram " : ""; result += ARBVertexProgram ? "ARBVertexProgram " : "";
result += NVVertexProgram ? "NVVertexProgram " : "";
result += EXTVertexShader ? "EXTVertexShader " : ""; result += EXTVertexShader ? "EXTVertexShader " : "";
result += NVVertexProgramEmulated ? "NVVertexProgramEmulated " : "";
result += "\n Misc: "; result += "\n Misc: ";
result += EXTVertexWeighting ? "EXTVertexWeighting " : ""; result += EXTVertexWeighting ? "EXTVertexWeighting " : "";
@ -315,72 +308,6 @@ extern NEL_PFNGLVERTEXWEIGHTFVEXTPROC nglVertexWeightfvEXT;
extern NEL_PFNGLVERTEXWEIGHTPOINTEREXTPROC nglVertexWeightPointerEXT; 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. // VertexShaderExtension.
//======================== //========================
extern NEL_PFNGLBEGINVERTEXSHADEREXTPROC nglBeginVertexShaderEXT; extern NEL_PFNGLBEGINVERTEXSHADEREXTPROC nglBeginVertexShaderEXT;

@ -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); 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) // VertexShaderExtension (EXT)
//============================ //============================
typedef void (APIENTRY * NEL_PFNGLBEGINVERTEXSHADEREXTPROC) ( void ); typedef void (APIENTRY * NEL_PFNGLBEGINVERTEXSHADEREXTPROC) ( void );

@ -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<CVertexBuffer::NumValue; value++)
{
// Index
uint glIndex=GLVertexAttribIndex[value];
_DriverGLStates.enableVertexAttribArray(glIndex, false);
}
_DriverGLStates.enableColorArray(false);
_DriverGLStates.enableSecondaryColorArray(false);
// no more a vertex program setup.
_LastSetupGLArrayVertexProgram= false;
}
// If last was a standard GL array setup, and now it is a VertexProgram setup.
if( !_LastSetupGLArrayVertexProgram && isVertexProgramEnabled () )
{
// Disable all standards ptrs.
_DriverGLStates.enableVertexArray(false);
_DriverGLStates.enableNormalArray(false);
_DriverGLStates.enableColorArray(false);
for(uint i=0; i<inlGetNumTextStages(); i++)
{
_DriverGLStates.clientActiveTextureARB(i);
_DriverGLStates.enableTexCoordArray(false);
}
// now, vertex program setup.
_LastSetupGLArrayVertexProgram= true;
}
}
// *************************************************************************** // ***************************************************************************
void CDriverGL3::toggleGlArraysForARBVertexProgram() void CDriverGL3::toggleGlArraysForARBVertexProgram()
{ {
@ -1021,94 +978,6 @@ void CDriverGL3::toggleGlArraysForEXTVertexShader()
} }
} }
// ***************************************************************************
void CDriverGL3::setupGlArraysForNVVertexProgram(CVertexBufferInfo &vb)
{
H_AUTO_OGL(CDriverGL3_setupGlArraysForNVVertexProgram)
uint16 flags= vb.VertexFormat;
_DriverGLStates.bindARBVertexBuffer(vb.VertexObjectId);
// For each value
for (uint value=0; value<CVertexBuffer::NumValue; value++)
{
//nldebug("3D: value = %d", value);
// Flag
uint16 flag=1<<value;
// Type
CVertexBuffer::TType type=vb.Type[value];
// Index
uint glIndex=GLVertexAttribIndex[value];
// Not setuped value and used
if (flags & flag)
{
/* OpenGL Driver Bug with VertexProgram, UChar4 type, and VertexArrayRange.
Don't work and lead to very poor performance (1/10) (VAR is "disabled").
*/
// Test if can use glColorPointer() / glSecondaryColorPointerEXT() instead.
if( (glIndex==3 || glIndex==4) )
{
if( type == CVertexBuffer::UChar4 )
{
// Must disable VertexAttrib array.
_DriverGLStates.enableVertexAttribArray(glIndex, false);
// Active this value, with standard gl calls
if(glIndex==3)
{
// Primary color
_DriverGLStates.enableColorArray(true);
glColorPointer(4,GL_UNSIGNED_BYTE, vb.VertexSize, vb.ValuePtr[value]);
}
else
{
// Secondary color
_DriverGLStates.enableSecondaryColorArray(true);
nglSecondaryColorPointerEXT(4, GL_UNSIGNED_BYTE, vb.VertexSize, vb.ValuePtr[value]);
}
}
else
{
// Can use normal VertexAttribArray.
// Disable first standard Color Array.
if(glIndex==3)
_DriverGLStates.enableColorArray(false);
else
_DriverGLStates.enableSecondaryColorArray(false);
// Active this value
_DriverGLStates.enableVertexAttribArray(glIndex, true);
nglVertexAttribPointerNV (glIndex, NumCoordinatesType[type], GLType[type], vb.VertexSize, vb.ValuePtr[value]);
}
}
// Else normal case, can't do anything for other values with UChar4....
else
{
// Active this value
_DriverGLStates.enableVertexAttribArray(glIndex, true);
nglVertexAttribPointerNV (glIndex, NumCoordinatesType[type], GLType[type], vb.VertexSize, vb.ValuePtr[value]);
}
}
else
{
_DriverGLStates.enableVertexAttribArray(glIndex, false);
/* OpenGL Driver Bug with VertexProgram, UChar4 type, and VertexArrayRange.
Must also disable colorArray in standard gl calls.
*/
if(glIndex==3)
_DriverGLStates.enableColorArray(false);
else if(glIndex==4)
_DriverGLStates.enableSecondaryColorArray(false);
}
}
_DriverGLStates.bindARBVertexBuffer(0);
}
// tells for each vertex argument if it must be normalized when it is an integral type // tells for each vertex argument if it must be normalized when it is an integral type
static const GLboolean ARBVertexProgramMustNormalizeAttrib[] = static const GLboolean ARBVertexProgramMustNormalizeAttrib[] =
{ {
@ -1293,21 +1162,7 @@ void CDriverGL3::setupGlArrays(CVertexBufferInfo &vb)
{ {
H_AUTO_OGL(CDriverGL3_setupGlArrays) H_AUTO_OGL(CDriverGL3_setupGlArrays)
// Standard case (NVVertexProgram or no vertex program case) if (_Extensions.ARBVertexProgram)
if (_Extensions.NVVertexProgram)
{
toggleGlArraysForNVVertexProgram();
// Use a vertex program ?
if (!isVertexProgramEnabled ())
{
setupGlArraysStd(vb);
}
else
{
setupGlArraysForNVVertexProgram(vb);
}
}
else if (_Extensions.ARBVertexProgram)
{ {
toggleGlArraysForARBVertexProgram(); toggleGlArraysForARBVertexProgram();
// Use a vertex program ? // Use a vertex program ?

@ -42,17 +42,11 @@ CVertexProgamDrvInfosGL3::CVertexProgamDrvInfosGL3 (CDriverGL3 *drv, ItVtxPrgDrv
H_AUTO_OGL(CVertexProgamDrvInfosGL_CVertexProgamDrvInfosGL); H_AUTO_OGL(CVertexProgamDrvInfosGL_CVertexProgamDrvInfosGL);
// Extension must exist // Extension must exist
nlassert (drv->_Extensions.NVVertexProgram nlassert (drv->_Extensions.EXTVertexShader
|| drv->_Extensions.EXTVertexShader
|| drv->_Extensions.ARBVertexProgram || drv->_Extensions.ARBVertexProgram
); );
if (drv->_Extensions.NVVertexProgram) // NVIDIA implemntation if (drv->_Extensions.ARBVertexProgram) // ARB implementation
{
// Generate a program
nglGenProgramsNV (1, &ID);
}
else if (drv->_Extensions.ARBVertexProgram) // ARB implementation
{ {
nglGenProgramsARB(1, &ID); nglGenProgramsARB(1, &ID);
} }
@ -67,133 +61,7 @@ CVertexProgamDrvInfosGL3::CVertexProgamDrvInfosGL3 (CDriverGL3 *drv, ItVtxPrgDrv
bool CDriverGL3::isVertexProgramSupported () const bool CDriverGL3::isVertexProgramSupported () const
{ {
H_AUTO_OGL(CVertexProgamDrvInfosGL_isVertexProgramSupported) H_AUTO_OGL(CVertexProgamDrvInfosGL_isVertexProgramSupported)
return _Extensions.NVVertexProgram || _Extensions.EXTVertexShader || _Extensions.ARBVertexProgram; return _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<length)&&(offset<(uint)errorOff))
{
if (sString[offset]=='\n')
{
line++;
charC=1;
}
else
charC++;
// Next character
offset++;
}
// Show the error
nlwarning("3D: Vertex program syntax error line %d character %d\n", line, charC);
// Disable vertex program
glDisable (GL_VERTEX_PROGRAM_NV);
_VertexProgramEnabled= false;
// Setup not ok
return false;
}
// Setup ok
return true;
}
else
{
// Cast the driver info pointer
drvInfo=safe_cast<CVertexProgamDrvInfosGL3*>((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;
} }
// *************************************************************************** // ***************************************************************************
@ -1612,11 +1480,7 @@ bool CDriverGL3::activeVertexProgram (CVertexProgram *program)
{ {
H_AUTO_OGL(CDriverGL3_activeVertexProgram) H_AUTO_OGL(CDriverGL3_activeVertexProgram)
// Extension here ? // Extension here ?
if (_Extensions.NVVertexProgram) if (_Extensions.ARBVertexProgram)
{
return activeNVVertexProgram(program);
}
else if (_Extensions.ARBVertexProgram)
{ {
return activeARBVertexProgram(program); 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); H_AUTO_OGL(CDriverGL3_setConstant);
// Vertex program exist ? // Vertex program exist ?
if (_Extensions.NVVertexProgram) if (_Extensions.ARBVertexProgram)
{
// Setup constant
nglProgramParameter4fNV (GL_VERTEX_PROGRAM_NV, index, f0, f1, f2, f3);
}
else if (_Extensions.ARBVertexProgram)
{ {
nglProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB, index, f0, f1, f2, f3); 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); H_AUTO_OGL(CDriverGL3_setConstant);
// Vertex program exist ? // Vertex program exist ?
if (_Extensions.NVVertexProgram) if (_Extensions.ARBVertexProgram)
{
// Setup constant
nglProgramParameter4dNV (GL_VERTEX_PROGRAM_NV, index, d0, d1, d2, d3);
}
else if (_Extensions.ARBVertexProgram)
{ {
nglProgramEnvParameter4dARB(GL_VERTEX_PROGRAM_ARB, index, d0, d1, d2, d3); 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); H_AUTO_OGL(CDriverGL3_setConstant);
// Vertex program exist ? // Vertex program exist ?
if (_Extensions.NVVertexProgram) if (_Extensions.ARBVertexProgram)
{
// Setup constant
nglProgramParameter4fNV (GL_VERTEX_PROGRAM_NV, index, value.x, value.y, value.z, 0);
}
else if (_Extensions.ARBVertexProgram)
{ {
nglProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB, index, value.x, value.y, value.z, 0); 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); H_AUTO_OGL(CDriverGL3_setConstant);
// Vertex program exist ? // Vertex program exist ?
if (_Extensions.NVVertexProgram) if (_Extensions.ARBVertexProgram)
{
// Setup constant
nglProgramParameter4dNV (GL_VERTEX_PROGRAM_NV, index, value.x, value.y, value.z, 0);
}
else if (_Extensions.ARBVertexProgram)
{ {
nglProgramEnvParameter4dARB(GL_VERTEX_PROGRAM_ARB, index, value.x, value.y, value.z, 0); 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); H_AUTO_OGL(CDriverGL3_setConstant);
// Vertex program exist ? // Vertex program exist ?
if (_Extensions.NVVertexProgram) if (_Extensions.ARBVertexProgram)
{
nglProgramParameters4fvNV(GL_VERTEX_PROGRAM_NV, index, num, src);
}
else if (_Extensions.ARBVertexProgram)
{ {
for(uint k = 0; k < num; ++k) 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); H_AUTO_OGL(CDriverGL3_setConstant);
// Vertex program exist ? // Vertex program exist ?
if (_Extensions.NVVertexProgram) if (_Extensions.ARBVertexProgram)
{
nglProgramParameters4dvNV(GL_VERTEX_PROGRAM_NV, index, num, src);
}
else if (_Extensions.ARBVertexProgram)
{ {
for(uint k = 0; k < num; ++k) 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); 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. // First, ensure that the render setup is correctly setuped.
refreshRenderSetup(); refreshRenderSetup();
@ -1890,15 +1714,7 @@ void CDriverGL3::enableVertexProgramDoubleSidedColor(bool doubleSided)
H_AUTO_OGL(CDriverGL3_enableVertexProgramDoubleSidedColor); H_AUTO_OGL(CDriverGL3_enableVertexProgramDoubleSidedColor);
// Vertex program exist ? // Vertex program exist ?
if (_Extensions.NVVertexProgram) if (_Extensions.ARBVertexProgram)
{
// 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)
{ {
// change mode (not cached because supposed to be rare) // change mode (not cached because supposed to be rare)
if(doubleSided) if(doubleSided)
@ -1914,7 +1730,7 @@ bool CDriverGL3::supportVertexProgramDoubleSidedColor() const
{ {
H_AUTO_OGL(CDriverGL3_supportVertexProgramDoubleSidedColor) H_AUTO_OGL(CDriverGL3_supportVertexProgramDoubleSidedColor)
// currently only supported by NV_VERTEX_PROGRAM && ARB_VERTEX_PROGRAM // currently only supported by NV_VERTEX_PROGRAM && ARB_VERTEX_PROGRAM
return _Extensions.NVVertexProgram || _Extensions.ARBVertexProgram; return _Extensions.ARBVertexProgram;
} }
#ifdef NL_STATIC #ifdef NL_STATIC

Loading…
Cancel
Save