mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 18:53:28 +01:00
d3d12: Do not use atomic for heaps
This commit is contained in:
parent
3acc900363
commit
81546d357c
@ -872,11 +872,14 @@ void D3D12GSRender::Flip()
|
||||
ResourceStorage &newStorage = getCurrentResourceStorage();
|
||||
|
||||
newStorage.WaitAndClean();
|
||||
m_constantsData.m_getPos.store(newStorage.m_getPosConstantsHeap, std::memory_order_release);
|
||||
m_vertexIndexData.m_getPos.store(newStorage.m_getPosVertexIndexHeap, std::memory_order_release);
|
||||
m_textureUploadData.m_getPos.store(newStorage.m_getPosTextureUploadHeap, std::memory_order_release);
|
||||
m_readbackResources.m_getPos.store(newStorage.m_getPosReadbackHeap, std::memory_order_release);
|
||||
m_UAVHeap.m_getPos.store(newStorage.m_getPosUAVHeap, std::memory_order_release);
|
||||
if (newStorage.m_inUse)
|
||||
{
|
||||
m_constantsData.m_getPos = newStorage.m_getPosConstantsHeap;
|
||||
m_vertexIndexData.m_getPos = newStorage.m_getPosVertexIndexHeap;
|
||||
m_textureUploadData.m_getPos = newStorage.m_getPosTextureUploadHeap;
|
||||
m_readbackResources.m_getPos = newStorage.m_getPosReadbackHeap;
|
||||
m_UAVHeap.m_getPos = newStorage.m_getPosUAVHeap;
|
||||
}
|
||||
|
||||
m_frame->Flip(nullptr);
|
||||
|
||||
|
@ -119,14 +119,14 @@ struct DataHeap
|
||||
T *m_heap;
|
||||
size_t m_size;
|
||||
size_t m_putPos; // Start of free space
|
||||
std::atomic<size_t> m_getPos; // End of free space
|
||||
size_t m_getPos; // End of free space
|
||||
|
||||
void Init(ID3D12Device *device, size_t heapSize, D3D12_HEAP_TYPE type, D3D12_HEAP_FLAGS flags)
|
||||
{
|
||||
m_size = heapSize;
|
||||
m_heap = InitHeap<T>::Init(device, heapSize, type, flags);
|
||||
m_putPos = 0;
|
||||
m_getPos = m_size - 1;
|
||||
m_getPos = heapSize - 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -135,7 +135,7 @@ struct DataHeap
|
||||
bool canAlloc(size_t size) const
|
||||
{
|
||||
size_t allocSize = align(size, Alignment);
|
||||
size_t currentGetPos = m_getPos.load();
|
||||
size_t currentGetPos = m_getPos;
|
||||
if (m_putPos + allocSize < m_size)
|
||||
{
|
||||
// range before get
|
||||
|
Loading…
Reference in New Issue
Block a user