Backed out changeset: 3937923211ec
This commit is contained in:
parent
213749f410
commit
cd04a596cd
1 changed files with 26 additions and 24 deletions
|
@ -46,21 +46,21 @@ CVertexProgamDrvInfosGL::CVertexProgamDrvInfosGL(CDriverGL *drv, ItGPUPrgDrvInfo
|
||||||
H_AUTO_OGL(CVertexProgamDrvInfosGL_CVertexProgamDrvInfosGL);
|
H_AUTO_OGL(CVertexProgamDrvInfosGL_CVertexProgamDrvInfosGL);
|
||||||
|
|
||||||
// Extension must exist
|
// Extension must exist
|
||||||
nlassert (drv->_Extensions.ARBVertexProgram
|
nlassert (drv->_Extensions.NVVertexProgram
|
||||||
|| drv->_Extensions.NVVertexProgram
|
|
||||||
|| drv->_Extensions.EXTVertexShader
|
|| drv->_Extensions.EXTVertexShader
|
||||||
|
|| drv->_Extensions.ARBVertexProgram
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifndef USE_OPENGLES
|
#ifndef USE_OPENGLES
|
||||||
|
if (drv->_Extensions.NVVertexProgram) // NVIDIA implemntation
|
||||||
|
{
|
||||||
// Generate a program
|
// Generate a program
|
||||||
if (drv->_Extensions.ARBVertexProgram) // ARB implementation
|
nglGenProgramsNV (1, &ID);
|
||||||
|
}
|
||||||
|
else if (drv->_Extensions.ARBVertexProgram) // ARB implementation
|
||||||
{
|
{
|
||||||
nglGenProgramsARB(1, &ID);
|
nglGenProgramsARB(1, &ID);
|
||||||
}
|
}
|
||||||
else if (drv->_Extensions.NVVertexProgram) // NVIDIA implementation
|
|
||||||
{
|
|
||||||
nglGenProgramsNV(1, &ID);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ID = nglGenVertexShadersEXT(1); // ATI implementation
|
ID = nglGenVertexShadersEXT(1); // ATI implementation
|
||||||
|
@ -74,7 +74,7 @@ bool CDriverGL::supportVertexProgram(CVertexProgram::TProfile profile) const
|
||||||
{
|
{
|
||||||
H_AUTO_OGL(CVertexProgamDrvInfosGL_supportVertexProgram)
|
H_AUTO_OGL(CVertexProgamDrvInfosGL_supportVertexProgram)
|
||||||
return (profile == CVertexProgram::nelvp)
|
return (profile == CVertexProgram::nelvp)
|
||||||
&& (_Extensions.ARBVertexProgram || _Extensions.NVVertexProgram || _Extensions.EXTVertexShader);
|
&& (_Extensions.NVVertexProgram || _Extensions.EXTVertexShader || _Extensions.ARBVertexProgram);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
|
@ -1774,6 +1774,7 @@ bool CDriverGL::compileVertexProgram(NL3D::CVertexProgram *program)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
|
|
||||||
bool CDriverGL::activeVertexProgram(CVertexProgram *program)
|
bool CDriverGL::activeVertexProgram(CVertexProgram *program)
|
||||||
{
|
{
|
||||||
H_AUTO_OGL(CDriverGL_activeVertexProgram)
|
H_AUTO_OGL(CDriverGL_activeVertexProgram)
|
||||||
|
@ -1782,14 +1783,14 @@ bool CDriverGL::activeVertexProgram(CVertexProgram *program)
|
||||||
if (program && !CDriverGL::compileVertexProgram(program)) return false;
|
if (program && !CDriverGL::compileVertexProgram(program)) return false;
|
||||||
|
|
||||||
// Extension
|
// Extension
|
||||||
if (_Extensions.ARBVertexProgram)
|
if (_Extensions.NVVertexProgram)
|
||||||
{
|
|
||||||
return activeARBVertexProgram(program);
|
|
||||||
}
|
|
||||||
else if (_Extensions.NVVertexProgram)
|
|
||||||
{
|
{
|
||||||
return activeNVVertexProgram(program);
|
return activeNVVertexProgram(program);
|
||||||
}
|
}
|
||||||
|
else if (_Extensions.ARBVertexProgram)
|
||||||
|
{
|
||||||
|
return activeARBVertexProgram(program);
|
||||||
|
}
|
||||||
else if (_Extensions.EXTVertexShader)
|
else if (_Extensions.EXTVertexShader)
|
||||||
{
|
{
|
||||||
return activeEXTVertexShader(program);
|
return activeEXTVertexShader(program);
|
||||||
|
@ -1807,15 +1808,7 @@ void CDriverGL::enableVertexProgramDoubleSidedColor(bool doubleSided)
|
||||||
|
|
||||||
#ifndef USE_OPENGLES
|
#ifndef USE_OPENGLES
|
||||||
// Vertex program exist ?
|
// Vertex program exist ?
|
||||||
if (_Extensions.ARBVertexProgram)
|
if (_Extensions.NVVertexProgram)
|
||||||
{
|
|
||||||
// change mode (not cached because supposed to be rare)
|
|
||||||
if(doubleSided)
|
|
||||||
glEnable (GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
|
|
||||||
else
|
|
||||||
glDisable (GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
|
|
||||||
}
|
|
||||||
else if (_Extensions.NVVertexProgram)
|
|
||||||
{
|
{
|
||||||
// change mode (not cached because supposed to be rare)
|
// change mode (not cached because supposed to be rare)
|
||||||
if(doubleSided)
|
if(doubleSided)
|
||||||
|
@ -1823,15 +1816,24 @@ void CDriverGL::enableVertexProgramDoubleSidedColor(bool doubleSided)
|
||||||
else
|
else
|
||||||
glDisable (GL_VERTEX_PROGRAM_TWO_SIDE_NV);
|
glDisable (GL_VERTEX_PROGRAM_TWO_SIDE_NV);
|
||||||
}
|
}
|
||||||
|
else if (_Extensions.ARBVertexProgram)
|
||||||
|
{
|
||||||
|
// change mode (not cached because supposed to be rare)
|
||||||
|
if(doubleSided)
|
||||||
|
glEnable (GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
|
||||||
|
else
|
||||||
|
glDisable (GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
bool CDriverGL::supportVertexProgramDoubleSidedColor() const
|
bool CDriverGL::supportVertexProgramDoubleSidedColor() const
|
||||||
{
|
{
|
||||||
H_AUTO_OGL(CDriverGL_supportVertexProgramDoubleSidedColor)
|
H_AUTO_OGL(CDriverGL_supportVertexProgramDoubleSidedColor)
|
||||||
// currently only supported by NV_VERTEX_PROGRAM && ARB_VERTEX_PROGRAM
|
// currently only supported by NV_VERTEX_PROGRAM && ARB_VERTEX_PROGRAM
|
||||||
return _Extensions.ARBVertexProgram || _Extensions.NVVertexProgram;
|
return _Extensions.NVVertexProgram || _Extensions.ARBVertexProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NL_STATIC
|
#ifdef NL_STATIC
|
||||||
|
|
Loading…
Reference in a new issue