GL3: Report correct location

--HG--
branch : opengl3
hg/feature/opengl3
kaetemi 11 years ago
parent 76cacae628
commit 85542abbfe

@ -123,22 +123,6 @@ bool CDriverGL3::setupVertexBuffer(CVertexBuffer& VB)
// Preferred memory, reduce choices // Preferred memory, reduce choices
CVertexBuffer::TPreferredMemory preferred = VB.getPreferredMemory(); CVertexBuffer::TPreferredMemory preferred = VB.getPreferredMemory();
CVertexBuffer::TLocation location;
switch (preferred)
{
case CVertexBuffer::StaticPreferred:
if (getStaticMemoryToVRAM())
location = CVertexBuffer::VRAMResident;
else
location = CVertexBuffer::AGPResident;
case CVertexBuffer::RAMVolatile:
case CVertexBuffer::RAMPreferred:
location = CVertexBuffer::RAMResident;
case CVertexBuffer::AGPPreferred:
case CVertexBuffer::AGPVolatile:
default:
location = CVertexBuffer::AGPResident;
}
const uint size = VB.capacity()*VB.getVertexSize(); const uint size = VB.capacity()*VB.getVertexSize();
@ -146,6 +130,29 @@ bool CDriverGL3::setupVertexBuffer(CVertexBuffer& VB)
info->_VBHard = createVertexBufferGL(size, VB.capacity(), preferred, &VB); info->_VBHard = createVertexBufferGL(size, VB.capacity(), preferred, &VB);
// Upload the data // Upload the data
CVertexBuffer::TLocation location;
if (info->_VBHard->VBType == IVertexBufferGL3::AMDPinned)
{
location = CVertexBuffer::RAMResident;
}
else
{
switch (preferred)
{
case CVertexBuffer::StaticPreferred:
if (getStaticMemoryToVRAM())
location = CVertexBuffer::VRAMResident;
else
location = CVertexBuffer::AGPResident;
case CVertexBuffer::RAMVolatile:
case CVertexBuffer::RAMPreferred:
location = CVertexBuffer::RAMResident;
case CVertexBuffer::AGPPreferred:
case CVertexBuffer::AGPVolatile:
default:
location = CVertexBuffer::AGPResident;
}
}
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);

Loading…
Cancel
Save