Some directx cleaning.
This commit is contained in:
parent
850bd6906f
commit
55ed0e9299
19 changed files with 900 additions and 487 deletions
|
@ -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();
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue