|
|
@ -123,7 +123,20 @@ bool CDriverGL3::setupVertexBuffer(CVertexBuffer& VB)
|
|
|
|
|
|
|
|
|
|
|
|
// Preferred memory, reduce choices
|
|
|
|
// Preferred memory, reduce choices
|
|
|
|
CVertexBuffer::TPreferredMemory preferred = VB.getPreferredMemory();
|
|
|
|
CVertexBuffer::TPreferredMemory preferred = VB.getPreferredMemory();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const uint size = VB.capacity()*VB.getVertexSize();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Vertex buffer hard
|
|
|
|
|
|
|
|
info->_VBHard = createVertexBufferGL(size, VB.capacity(), preferred, &VB);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Upload the data
|
|
|
|
CVertexBuffer::TLocation location;
|
|
|
|
CVertexBuffer::TLocation location;
|
|
|
|
|
|
|
|
if (info->_VBHard->VBType == IVertexBufferGL3::AMDPinned)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
location = CVertexBuffer::RAMResident;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
switch (preferred)
|
|
|
|
switch (preferred)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case CVertexBuffer::StaticPreferred:
|
|
|
|
case CVertexBuffer::StaticPreferred:
|
|
|
@ -139,13 +152,7 @@ bool CDriverGL3::setupVertexBuffer(CVertexBuffer& VB)
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
location = CVertexBuffer::AGPResident;
|
|
|
|
location = CVertexBuffer::AGPResident;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
const uint size = VB.capacity()*VB.getVertexSize();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Vertex buffer hard
|
|
|
|
|
|
|
|
info->_VBHard = createVertexBufferGL(size, VB.capacity(), preferred, &VB);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Upload the data
|
|
|
|
|
|
|
|
VB.setLocation(location);
|
|
|
|
VB.setLocation(location);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -269,7 +276,7 @@ IVertexBufferGL3 *CDriverGL3::createVertexBufferGL(uint size, uint numVertices,
|
|
|
|
|
|
|
|
|
|
|
|
if (_Extensions.AMDPinnedMemory && (
|
|
|
|
if (_Extensions.AMDPinnedMemory && (
|
|
|
|
preferred == CVertexBuffer::RAMPreferred
|
|
|
|
preferred == CVertexBuffer::RAMPreferred
|
|
|
|
// || preferred == CVertexBuffer::AGPPreferred
|
|
|
|
|| preferred == CVertexBuffer::AGPPreferred
|
|
|
|
))
|
|
|
|
))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
result = new CVertexBufferAMDPinned(this, size, numVertices, preferred, vb);
|
|
|
|
result = new CVertexBufferAMDPinned(this, size, numVertices, preferred, vb);
|
|
|
|