Removed more stuff that's no longer neccessary now that we only work with VBO.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 12 years ago
parent 6360302a2b
commit cfc4565b5d

@ -1202,7 +1202,6 @@ inline void CVertexBuffer::lock (CVertexBufferRead &accessor, uint first, uint l
if (last == 0)
last = _NbVerts;
// Can read it ?
//nlassertex (_Location==RAMResident, ("Try to read a write only vertex buffer"));
_LockedBuffer = DrvInfos->lock (first*_VertexSize, last*_VertexSize, true);
}
else

@ -251,17 +251,11 @@ public:
// NB: ptrs are invalid if VertexFormat does not support the compoennt. must test VertexFormat, not the ptr.
void *ValuePtr[CVertexBuffer::NumValue];
enum TVBMode { TVBModeNone = 0, SysMem, HW }; // standard VBs, or Hard VBs using different extensions
// Kind of vb
TVBMode VBMode;
// the handle of ATI or ARB vertex object
uint VertexObjectId;
CVertexBufferInfo()
{
VBMode = TVBModeNone;
}
void setupVertexBuffer(CVertexBuffer &vb);

@ -169,16 +169,10 @@ bool CDriverGL3::activeVertexBuffer(CVertexBuffer& VB)
// 2. Setup Arrays.
//===================
// For MultiPass Material.
CVertexBufferInfo::TVBMode lastVBMode = _LastVB.VBMode;
CVBDrvInfosGL3 *info= safe_cast<CVBDrvInfosGL3*>((IVBDrvInfos*)VB.DrvInfos);
if (!info->_VBHard || (info->_VBHard && !info->_VBHard->isInvalid()))
{
_LastVB.setupVertexBuffer(VB);
if (lastVBMode == CVertexBufferInfo::HW && _LastVB.VBMode != CVertexBufferInfo::HW)
{
_DriverGLStates.bindARBVertexBuffer(0); // unbind ARB vertex buffer
}
}
if (info->_VBHard == NULL)
{
// Disable the current vertexBufferHard if setuped.
@ -252,10 +246,6 @@ bool CDriverGL3::renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines)
_PrimitiveProfileIn.NLines+= nlines;
_PrimitiveProfileOut.NLines+= nlines;
// We have render some prims. inform the VBHard.
if(_CurrentVertexBufferHard)
_CurrentVertexBufferHard->GPURenderingAfterFence= true;
return true;
}
@ -309,9 +299,6 @@ bool CDriverGL3::renderTriangles(CMaterial& mat, uint32 firstIndex, uint32 ntris
_PrimitiveProfileIn.NTriangles+= ntris;
_PrimitiveProfileOut.NTriangles+= ntris * nPass;
// We have render some prims. inform the VBHard.
if(_CurrentVertexBufferHard)
_CurrentVertexBufferHard->GPURenderingAfterFence= true;
return true;
}
@ -348,10 +335,6 @@ bool CDriverGL3::renderSimpleTriangles(uint32 firstTri, uint32 ntris)
_PrimitiveProfileIn.NTriangles+= ntris;
_PrimitiveProfileOut.NTriangles+= ntris;
// We have render some prims. inform the VBHard.
if(_CurrentVertexBufferHard)
_CurrentVertexBufferHard->GPURenderingAfterFence= true;
return true;
}
@ -390,9 +373,6 @@ bool CDriverGL3::renderRawPoints(CMaterial& mat, uint32 startIndex, uint32 numPo
_PrimitiveProfileIn.NPoints+= numPoints;
_PrimitiveProfileOut.NPoints+= numPoints * nPass;
// We have render some prims. inform the VBHard.
if(_CurrentVertexBufferHard)
_CurrentVertexBufferHard->GPURenderingAfterFence= true;
return true;
}
@ -431,9 +411,6 @@ bool CDriverGL3::renderRawLines(CMaterial& mat, uint32 startIndex, uint32 numLin
_PrimitiveProfileIn.NLines += numLines ;
_PrimitiveProfileOut.NLines += numLines * nPass;
// We have render some prims. inform the VBHard.
if(_CurrentVertexBufferHard)
_CurrentVertexBufferHard->GPURenderingAfterFence= true;
return true;
}
@ -474,9 +451,6 @@ bool CDriverGL3::renderRawTriangles(CMaterial& mat, uint32 startIndex, uint32 nu
_PrimitiveProfileIn.NTriangles += numTris ;
_PrimitiveProfileOut.NTriangles += numTris * nPass;
// We have render some prims. inform the VBHard.
if(_CurrentVertexBufferHard)
_CurrentVertexBufferHard->GPURenderingAfterFence= true;
return true;
}
@ -598,9 +572,6 @@ bool CDriverGL3::renderRawQuads(CMaterial& mat, uint32 startIndex, uint32 numQua
_PrimitiveProfileIn.NQuads += numQuads ;
_PrimitiveProfileOut.NQuads += numQuads * nPass;
// We have render some prims. inform the VBHard.
if(_CurrentVertexBufferHard)
_CurrentVertexBufferHard->GPURenderingAfterFence= true;
return true;
}
@ -622,20 +593,10 @@ void CDriverGL3::setupUVPtr(uint stage, CVertexBufferInfo &VB, uint uvId)
{
_DriverGLStates.enableTexCoordArray(true);
uint numTexCoord = (uvType == CVertexBuffer::Float2) ? 2 : 3;
// Setup ATI VBHard or std ptr.
switch(VB.VBMode)
{
case CVertexBufferInfo::HW:
_DriverGLStates.bindARBVertexBuffer(VB.VertexObjectId);
// with arb buffers, position is relative to the start of the stream
glTexCoordPointer(numTexCoord,GL_FLOAT,VB.VertexSize, VB.ValuePtr[CVertexBuffer::TexCoord0+uvId]);
break;
case CVertexBufferInfo::SysMem:
glTexCoordPointer(numTexCoord,GL_FLOAT,VB.VertexSize, VB.ValuePtr[CVertexBuffer::TexCoord0+uvId]);
break;
default:
break;
}
_DriverGLStates.bindARBVertexBuffer(VB.VertexObjectId);
// with arb buffers, position is relative to the start of the stream
glTexCoordPointer(numTexCoord,GL_FLOAT,VB.VertexSize, VB.ValuePtr[CVertexBuffer::TexCoord0+uvId]);
}
else
{
@ -826,15 +787,9 @@ void CDriverGL3::setupGlArraysStd(CVertexBufferInfo &vb)
H_AUTO_OGL(CDriverGL3_setupGlArraysStd)
uint32 flags= vb.VertexFormat;
if (vb.VBMode == CVertexBufferInfo::HW)
{
_DriverGLStates.bindARBVertexBuffer(vb.VertexObjectId);
}
_DriverGLStates.bindARBVertexBuffer(vb.VertexObjectId);
switch(vb.VBMode)
{
case CVertexBufferInfo::SysMem:
case CVertexBufferInfo::HW:
{
// setup vertex ptr.
//-----------
@ -875,11 +830,6 @@ void CDriverGL3::setupGlArraysStd(CVertexBufferInfo &vb)
_DriverGLStates.enableColorArray(false);
}
}
break;
default:
nlassert(0);
break;
}
// Setup Uvs
@ -1059,8 +1009,7 @@ void CDriverGL3::setupGlArraysForNVVertexProgram(CVertexBufferInfo &vb)
H_AUTO_OGL(CDriverGL3_setupGlArraysForNVVertexProgram)
uint16 flags= vb.VertexFormat;
if (vb.VBMode == CVertexBufferInfo::HW)
_DriverGLStates.bindARBVertexBuffer(vb.VertexObjectId);
_DriverGLStates.bindARBVertexBuffer(vb.VertexObjectId);
// For each value
for (uint value=0; value<CVertexBuffer::NumValue; value++)
@ -1138,8 +1087,7 @@ void CDriverGL3::setupGlArraysForNVVertexProgram(CVertexBufferInfo &vb)
}
}
if (vb.VBMode == CVertexBufferInfo::HW)
_DriverGLStates.bindARBVertexBuffer(0);
_DriverGLStates.bindARBVertexBuffer(0);
}
@ -1172,11 +1120,7 @@ void CDriverGL3::setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb)
uint32 flags= vb.VertexFormat;
nlctassert(CVertexBuffer::NumValue == sizeof(ARBVertexProgramMustNormalizeAttrib) / sizeof(ARBVertexProgramMustNormalizeAttrib[0]));
if (vb.VBMode == CVertexBufferInfo::HW)
{
_DriverGLStates.bindARBVertexBuffer(vb.VertexObjectId);
}
_DriverGLStates.bindARBVertexBuffer(vb.VertexObjectId);
{
// For each value
@ -1226,10 +1170,7 @@ void CDriverGL3::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb)
uint32 flags= vb.VertexFormat;
if (vb.VBMode == CVertexBufferInfo::HW)
{
_DriverGLStates.bindARBVertexBuffer(vb.VertexObjectId);
}
_DriverGLStates.bindARBVertexBuffer(vb.VertexObjectId);
// For each value
for (uint value=0; value<CVertexBuffer::NumValue; value++)

@ -30,18 +30,6 @@ namespace NL3D {
namespace NLDRIVERGL3 {
#endif
// ***************************************************************************
// ***************************************************************************
// ***************************************************************************
//
// VBHard interface for both NVidia / ATI extension.
//
// ***************************************************************************
// ***************************************************************************
// ***************************************************************************
// ***************************************************************************
IVertexArrayRange::IVertexArrayRange(CDriverGL3 *drv)
{
@ -59,8 +47,6 @@ IVertexBufferHardGL::IVertexBufferHardGL(CDriverGL3 *drv, CVertexBuffer *vb) : V
{
H_AUTO_OGL(IVertexBufferHardGL_IVertexBufferHardGL)
_Driver= drv;
GPURenderingAfterFence= false;
VBType = UnknownVB;
_Invalid = false;
}
// ***************************************************************************
@ -70,15 +56,6 @@ IVertexBufferHardGL::~IVertexBufferHardGL()
}
// ***************************************************************************
// ***************************************************************************
// ***************************************************************************
// ARB implementation
// ***************************************************************************
// ***************************************************************************
// ***************************************************************************
// ***************************************************************************
// CVertexArrayRangeARB
// ***************************************************************************
@ -185,8 +162,7 @@ CVertexBufferHardARB::CVertexBufferHardARB(CDriverGL3 *drv, CVertexBuffer *vb) :
{
H_AUTO_OGL(CVertexBufferHardARB_CVertexBufferHardARB)
// Flag our type
VBType = ARBVB;
_VertexArrayRange = NULL;
#ifdef NL_DEBUG
_Unmapping = false;
@ -418,7 +394,6 @@ void CVertexBufferHardARB::lockHintStatic(bool /* staticLock */)
void CVertexBufferHardARB::setupVBInfos(CVertexBufferInfo &vb)
{
H_AUTO_OGL(CVertexBufferHardARB_setupVBInfos)
vb.VBMode = CVertexBufferInfo::HW;
vb.VertexObjectId = _VertexObjectId;
}

@ -89,12 +89,6 @@ public:
virtual void setupVBInfos(CVertexBufferInfo &vb) = 0;
enum TVBType { NVidiaVB, ATIVB, ATIMapObjectVB, ARBVB, UnknownVB };
// true if NVidia vertex buffer hard.
TVBType VBType;
// For Fence access. Ignored for ATI.
bool GPURenderingAfterFence;
// test if buffer content is invalid. If so, no rendering should occurs (rendering should silently fail)
bool isInvalid() { return _Invalid; }

Loading…
Cancel
Save