Some directx cleaning.

This commit is contained in:
jmsgrogan 2023-01-06 13:03:51 +00:00
parent 850bd6906f
commit 55ed0e9299
19 changed files with 900 additions and 487 deletions

View file

@ -0,0 +1,37 @@
#include "DirectXCommandList.h"
#include <d3d12.h>
void DirectXCommandList::close()
{
mCommandList->Close();
}
void DirectXCommandList::create(ID3D12Device* device, ID3D12PipelineState* pso)
{
device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(&mCommandAllocator));
device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, mCommandAllocator.Get(), pso, IID_PPV_ARGS(&mCommandList));
mCommandList->Close();
}
ID3D12GraphicsCommandList* DirectXCommandList::get() const
{
return mCommandList.Get();
}
void DirectXCommandList::execute(ID3D12CommandQueue* queue)
{
ID3D12CommandList* ppCommandLists[] = { mCommandList.Get() };
queue->ExecuteCommandLists(_countof(ppCommandLists), ppCommandLists);
}
void DirectXCommandList::reset(ID3D12PipelineState* pso)
{
mCommandList->Reset(mCommandAllocator.Get(), pso);
}
void DirectXCommandList::resetAllocator()
{
mCommandAllocator.Reset();
}