Add D3D12 view wrapper classes: RTV, DSV, SRV, CBV
This commit is contained in:
27
engine/include/XCEngine/RHI/D3D12/D3D12ConstantBufferView.h
Normal file
27
engine/include/XCEngine/RHI/D3D12/D3D12ConstantBufferView.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <d3d12.h>
|
||||
#include <wrl/client.h>
|
||||
|
||||
using Microsoft::WRL::ComPtr;
|
||||
|
||||
namespace XCEngine {
|
||||
namespace RHI {
|
||||
|
||||
class D3D12ConstantBufferView {
|
||||
public:
|
||||
D3D12ConstantBufferView();
|
||||
~D3D12ConstantBufferView();
|
||||
|
||||
void Initialize(ID3D12Device* device, ID3D12Resource* buffer, const D3D12_CONSTANT_BUFFER_VIEW_DESC* desc = nullptr);
|
||||
void Shutdown();
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() const { return m_handle; }
|
||||
|
||||
private:
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE m_handle;
|
||||
ID3D12Resource* m_resource;
|
||||
};
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
27
engine/include/XCEngine/RHI/D3D12/D3D12DepthStencilView.h
Normal file
27
engine/include/XCEngine/RHI/D3D12/D3D12DepthStencilView.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <d3d12.h>
|
||||
#include <wrl/client.h>
|
||||
|
||||
using Microsoft::WRL::ComPtr;
|
||||
|
||||
namespace XCEngine {
|
||||
namespace RHI {
|
||||
|
||||
class D3D12DepthStencilView {
|
||||
public:
|
||||
D3D12DepthStencilView();
|
||||
~D3D12DepthStencilView();
|
||||
|
||||
void Initialize(ID3D12Device* device, ID3D12Resource* resource, const D3D12_DEPTH_STENCIL_VIEW_DESC* desc = nullptr);
|
||||
void Shutdown();
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() const { return m_handle; }
|
||||
|
||||
private:
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE m_handle;
|
||||
ID3D12Resource* m_resource;
|
||||
};
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
27
engine/include/XCEngine/RHI/D3D12/D3D12RenderTargetView.h
Normal file
27
engine/include/XCEngine/RHI/D3D12/D3D12RenderTargetView.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <d3d12.h>
|
||||
#include <wrl/client.h>
|
||||
|
||||
using Microsoft::WRL::ComPtr;
|
||||
|
||||
namespace XCEngine {
|
||||
namespace RHI {
|
||||
|
||||
class D3D12RenderTargetView {
|
||||
public:
|
||||
D3D12RenderTargetView();
|
||||
~D3D12RenderTargetView();
|
||||
|
||||
void Initialize(ID3D12Device* device, ID3D12Resource* resource, const D3D12_RENDER_TARGET_VIEW_DESC* desc = nullptr);
|
||||
void Shutdown();
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() const { return m_handle; }
|
||||
|
||||
private:
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE m_handle;
|
||||
ID3D12Resource* m_resource;
|
||||
};
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
27
engine/include/XCEngine/RHI/D3D12/D3D12ShaderResourceView.h
Normal file
27
engine/include/XCEngine/RHI/D3D12/D3D12ShaderResourceView.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <d3d12.h>
|
||||
#include <wrl/client.h>
|
||||
|
||||
using Microsoft::WRL::ComPtr;
|
||||
|
||||
namespace XCEngine {
|
||||
namespace RHI {
|
||||
|
||||
class D3D12ShaderResourceView {
|
||||
public:
|
||||
D3D12ShaderResourceView();
|
||||
~D3D12ShaderResourceView();
|
||||
|
||||
void Initialize(ID3D12Device* device, ID3D12Resource* resource, const D3D12_SHADER_RESOURCE_VIEW_DESC* desc = nullptr);
|
||||
void Shutdown();
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() const { return m_handle; }
|
||||
|
||||
private:
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE m_handle;
|
||||
ID3D12Resource* m_resource;
|
||||
};
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user