Add CreateDesc for D3D12RenderTargetView
This commit is contained in:
@@ -3,6 +3,9 @@
|
|||||||
#include <d3d12.h>
|
#include <d3d12.h>
|
||||||
#include <wrl/client.h>
|
#include <wrl/client.h>
|
||||||
|
|
||||||
|
#include "../Enums.h"
|
||||||
|
#include "D3D12Enum.h"
|
||||||
|
|
||||||
using Microsoft::WRL::ComPtr;
|
using Microsoft::WRL::ComPtr;
|
||||||
|
|
||||||
namespace XCEngine {
|
namespace XCEngine {
|
||||||
@@ -19,6 +22,8 @@ public:
|
|||||||
|
|
||||||
D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() const { return m_handle; }
|
D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() const { return m_handle; }
|
||||||
|
|
||||||
|
static D3D12_RENDER_TARGET_VIEW_DESC CreateDesc(Format format, D3D12_RTV_DIMENSION dimension = D3D12_RTV_DIMENSION_TEXTURE2D);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
D3D12_CPU_DESCRIPTOR_HANDLE m_handle;
|
D3D12_CPU_DESCRIPTOR_HANDLE m_handle;
|
||||||
ID3D12Resource* m_resource;
|
ID3D12Resource* m_resource;
|
||||||
|
|||||||
@@ -29,5 +29,12 @@ void D3D12RenderTargetView::Shutdown() {
|
|||||||
m_resource = nullptr;
|
m_resource = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
D3D12_RENDER_TARGET_VIEW_DESC D3D12RenderTargetView::CreateDesc(Format format, D3D12_RTV_DIMENSION dimension) {
|
||||||
|
D3D12_RENDER_TARGET_VIEW_DESC desc = {};
|
||||||
|
desc.Format = ToD3D12(format);
|
||||||
|
desc.ViewDimension = dimension;
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace RHI
|
} // namespace RHI
|
||||||
} // namespace XCEngine
|
} // namespace XCEngine
|
||||||
|
|||||||
Reference in New Issue
Block a user