Files
XCEngine/tests/RHI/D3D12/unit/fixtures/D3D12TestFixture.h

38 lines
1.1 KiB
C
Raw Normal View History

#pragma once
#include <gtest/gtest.h>
#include <wrl/client.h>
#include "XCEngine/RHI/D3D12/D3D12Device.h"
#include "XCEngine/RHI/D3D12/D3D12CommandQueue.h"
#include "XCEngine/RHI/D3D12/D3D12CommandAllocator.h"
#include "XCEngine/RHI/D3D12/D3D12CommandList.h"
#include "XCEngine/RHI/D3D12/D3D12Fence.h"
namespace XCEngine {
namespace RHI {
class D3D12TestFixture : public ::testing::Test {
protected:
static void SetUpTestSuite();
static void TearDownTestSuite();
void SetUp() override;
void TearDown() override;
D3D12Device* GetDevice() { return m_device.get(); }
D3D12CommandQueue* GetCommandQueue() { return m_commandQueue.get(); }
D3D12CommandList* GetCommandList() { return m_commandList.get(); }
D3D12CommandAllocator* GetCommandAllocator() { return m_commandAllocator.get(); }
void WaitForGPU();
private:
std::unique_ptr<D3D12Device> m_device;
std::unique_ptr<D3D12CommandQueue> m_commandQueue;
std::unique_ptr<D3D12CommandAllocator> m_commandAllocator;
std::unique_ptr<D3D12CommandList> m_commandList;
};
} // namespace RHI
} // namespace XCEngine