Replace RTV/DSV/SRV creation with wrapper classes
This commit is contained in:
@@ -14,6 +14,7 @@ public:
|
||||
~D3D12DepthStencilView();
|
||||
|
||||
void Initialize(ID3D12Device* device, ID3D12Resource* resource, const D3D12_DEPTH_STENCIL_VIEW_DESC* desc = nullptr);
|
||||
void InitializeAt(ID3D12Device* device, ID3D12Resource* resource, D3D12_CPU_DESCRIPTOR_HANDLE handle, const D3D12_DEPTH_STENCIL_VIEW_DESC* desc = nullptr);
|
||||
void Shutdown();
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() const { return m_handle; }
|
||||
|
||||
@@ -14,6 +14,7 @@ public:
|
||||
~D3D12RenderTargetView();
|
||||
|
||||
void Initialize(ID3D12Device* device, ID3D12Resource* resource, const D3D12_RENDER_TARGET_VIEW_DESC* desc = nullptr);
|
||||
void InitializeAt(ID3D12Device* device, ID3D12Resource* resource, D3D12_CPU_DESCRIPTOR_HANDLE handle, const D3D12_RENDER_TARGET_VIEW_DESC* desc = nullptr);
|
||||
void Shutdown();
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() const { return m_handle; }
|
||||
|
||||
@@ -14,6 +14,7 @@ public:
|
||||
~D3D12ShaderResourceView();
|
||||
|
||||
void Initialize(ID3D12Device* device, ID3D12Resource* resource, const D3D12_SHADER_RESOURCE_VIEW_DESC* desc = nullptr);
|
||||
void InitializeAt(ID3D12Device* device, ID3D12Resource* resource, D3D12_CPU_DESCRIPTOR_HANDLE handle, const D3D12_SHADER_RESOURCE_VIEW_DESC* desc = nullptr);
|
||||
void Shutdown();
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() const { return m_handle; }
|
||||
|
||||
@@ -18,6 +18,12 @@ void D3D12DepthStencilView::Initialize(ID3D12Device* device, ID3D12Resource* res
|
||||
device->CreateDepthStencilView(resource, desc, m_handle);
|
||||
}
|
||||
|
||||
void D3D12DepthStencilView::InitializeAt(ID3D12Device* device, ID3D12Resource* resource, D3D12_CPU_DESCRIPTOR_HANDLE handle, const D3D12_DEPTH_STENCIL_VIEW_DESC* desc) {
|
||||
m_resource = resource;
|
||||
m_handle = handle;
|
||||
device->CreateDepthStencilView(resource, desc, m_handle);
|
||||
}
|
||||
|
||||
void D3D12DepthStencilView::Shutdown() {
|
||||
m_handle = {};
|
||||
m_resource = nullptr;
|
||||
|
||||
@@ -18,6 +18,12 @@ void D3D12RenderTargetView::Initialize(ID3D12Device* device, ID3D12Resource* res
|
||||
device->CreateRenderTargetView(resource, desc, m_handle);
|
||||
}
|
||||
|
||||
void D3D12RenderTargetView::InitializeAt(ID3D12Device* device, ID3D12Resource* resource, D3D12_CPU_DESCRIPTOR_HANDLE handle, const D3D12_RENDER_TARGET_VIEW_DESC* desc) {
|
||||
m_resource = resource;
|
||||
m_handle = handle;
|
||||
device->CreateRenderTargetView(resource, desc, m_handle);
|
||||
}
|
||||
|
||||
void D3D12RenderTargetView::Shutdown() {
|
||||
m_handle = {};
|
||||
m_resource = nullptr;
|
||||
|
||||
@@ -18,6 +18,12 @@ void D3D12ShaderResourceView::Initialize(ID3D12Device* device, ID3D12Resource* r
|
||||
device->CreateShaderResourceView(resource, desc, m_handle);
|
||||
}
|
||||
|
||||
void D3D12ShaderResourceView::InitializeAt(ID3D12Device* device, ID3D12Resource* resource, D3D12_CPU_DESCRIPTOR_HANDLE handle, const D3D12_SHADER_RESOURCE_VIEW_DESC* desc) {
|
||||
m_resource = resource;
|
||||
m_handle = handle;
|
||||
device->CreateShaderResourceView(resource, desc, m_handle);
|
||||
}
|
||||
|
||||
void D3D12ShaderResourceView::Shutdown() {
|
||||
m_handle = {};
|
||||
m_resource = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user