|
|
@ -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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|