Add AbstractGfx for DX12

This commit is contained in:
Scott Mansell
2023-01-29 23:58:54 +13:00
parent 5a2d119bda
commit 8ad59f8ccf
9 changed files with 119 additions and 149 deletions

View File

@ -8,7 +8,7 @@
#include "Common/StringUtil.h"
#include "VideoBackends/D3D12/Common.h"
#include "VideoBackends/D3D12/D3D12Renderer.h"
#include "VideoBackends/D3D12/D3D12Gfx.h"
#include "VideoBackends/D3D12/D3D12StreamBuffer.h"
#include "VideoBackends/D3D12/DX12Context.h"
#include "VideoBackends/D3D12/DescriptorHeapManager.h"
@ -254,7 +254,7 @@ void DXTexture::Load(u32 level, u32 width, u32 height, u32 row_length, const u8*
{
WARN_LOG_FMT(VIDEO,
"Executing command list while waiting for space in texture upload buffer");
Renderer::GetInstance()->ExecuteCommandList(false);
Gfx::GetInstance()->ExecuteCommandList(false);
if (!g_dx_context->GetTextureUploadBuffer().ReserveMemory(
upload_size, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT))
{
@ -632,7 +632,7 @@ void DXStagingTexture::Flush()
// the current list and wait for it to complete. This is the slowest path. Otherwise, if the
// command list with the copy has been submitted, we only need to wait for the fence.
if (m_completed_fence == g_dx_context->GetCurrentFenceValue())
Renderer::GetInstance()->ExecuteCommandList(true);
Gfx::GetInstance()->ExecuteCommandList(true);
else
g_dx_context->WaitForFence(m_completed_fence);
}