Always prefer VBOs as OpenGL core requires the use of VBOs.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 11 years ago
parent ee2c14670e
commit bb6195f858

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

@ -145,19 +145,15 @@ bool CDriverGL3::setupVertexBuffer(CVertexBuffer& VB)
// Preferred memory // Preferred memory
CVertexBuffer::TPreferredMemory preferred = VB.getPreferredMemory (); CVertexBuffer::TPreferredMemory preferred = VB.getPreferredMemory ();
if ((preferred == CVertexBuffer::RAMVolatile) || (preferred == CVertexBuffer::AGPVolatile)) if ((preferred == CVertexBuffer::RAMVolatile) ||
preferred = CVertexBuffer::RAMPreferred; (preferred == CVertexBuffer::AGPVolatile) ||
(preferred == CVertexBuffer::RAMPreferred ) )
preferred = CVertexBuffer::AGPPreferred;
const uint size = VB.capacity()*VB.getVertexSize(); const uint size = VB.capacity()*VB.getVertexSize();
uint preferredMemory = _Extensions.DisableHardwareVertexArrayAGP ? CVertexBuffer::RAMPreferred : preferred;
while (preferredMemory != CVertexBuffer::RAMPreferred)
{
// Vertex buffer hard
info->_VBHard = createVertexBufferHard(size, VB.capacity(), (CVertexBuffer::TPreferredMemory)preferredMemory, &VB);
if (info->_VBHard)
break;
preferredMemory--;
}
// Vertex buffer hard
info->_VBHard = createVertexBufferHard(size, VB.capacity(), preferred, &VB);
// No memory found ? Use system memory // No memory found ? Use system memory
if (info->_VBHard == NULL) if (info->_VBHard == NULL)
{ {
@ -166,7 +162,7 @@ bool CDriverGL3::setupVertexBuffer(CVertexBuffer& VB)
} }
// Upload the data // Upload the data
VB.setLocation ((CVertexBuffer::TLocation)preferredMemory); VB.setLocation ((CVertexBuffer::TLocation)preferred);
} }
} }

Loading…
Cancel
Save