[idd] rewrite to support DirectX12 copy

This commit is contained in:
Geoffrey McRae
2025-03-16 12:32:52 +00:00
parent 62c075cfb5
commit 8b198091ce
28 changed files with 1168 additions and 247 deletions

View File

@@ -0,0 +1,31 @@
#include "CFrameBufferPool.h"
#include "CSwapChainProcessor.h"
#include <stdint.h>
void CFrameBufferPool::Init(CSwapChainProcessor * swapChain)
{
m_swapChain = swapChain;
}
void CFrameBufferPool::Reset()
{
for (int i = 0; i < ARRAYSIZE(m_buffers); ++i)
m_buffers[i].Reset();
}
CFrameBufferResource * CFrameBufferPool::Get(const CIndirectDeviceContext::PreparedFrameBuffer& buffer, size_t minSize)
{
if (buffer.frameIndex > ARRAYSIZE(m_buffers) - 1)
return nullptr;
CFrameBufferResource* fbr = &m_buffers[buffer.frameIndex];
if (!fbr->IsValid() || fbr->GetBase() != buffer.mem || fbr->GetSize() < minSize)
{
fbr->Reset();
if (!fbr->Init(m_swapChain, buffer.mem, minSize))
return nullptr;
}
return fbr;
}