mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
D3D12: Refactoring and cleanups
Moves render target restoring to RestoreAPIState, this also means no need to manually restore after allocating in a buffer that caused execution, because the manager restores it for us. Remove a method that wasn't used from D3DUtil.cpp, and fixes a few errors in EFB poke drawing.
This commit is contained in:
@ -121,12 +121,7 @@ void BBox::Set(int index, int value)
|
||||
memcpy(reinterpret_cast<u8*>(s_bbox_staging_buffer_map) + (index * sizeof(int)), &value, sizeof(int));
|
||||
}
|
||||
|
||||
if (s_bbox_stream_buffer->AllocateSpaceInBuffer(sizeof(int), sizeof(int)))
|
||||
{
|
||||
// Command list was executed, reset state
|
||||
g_renderer->SetViewport();
|
||||
FramebufferManager::RestoreEFBRenderTargets();
|
||||
}
|
||||
s_bbox_stream_buffer->AllocateSpaceInBuffer(sizeof(int), sizeof(int));
|
||||
|
||||
// Allocate temporary bytes in upload buffer, then copy to real buffer.
|
||||
memcpy(s_bbox_stream_buffer->GetCPUAddressOfCurrentAllocation(), &value, sizeof(int));
|
||||
@ -147,8 +142,6 @@ int BBox::Get(int index)
|
||||
D3D::ResourceBarrier(D3D::current_command_list, s_bbox_buffer, D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_UNORDERED_ACCESS, 0);
|
||||
|
||||
D3D::command_list_mgr->ExecuteQueuedWork(true);
|
||||
g_renderer->SetViewport();
|
||||
FramebufferManager::RestoreEFBRenderTargets();
|
||||
|
||||
CheckHR(s_bbox_staging_buffer->Map(0, nullptr, &s_bbox_staging_buffer_map));
|
||||
}
|
||||
|
Reference in New Issue
Block a user