Make D3D12DescriptorHeap implement IDescriptorHeap interface
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include <wrl/client.h>
|
||||
|
||||
#include "../Enums.h"
|
||||
#include "../Types.h"
|
||||
#include "../DescriptorHeap.h"
|
||||
#include "D3D12Enum.h"
|
||||
|
||||
using Microsoft::WRL::ComPtr;
|
||||
@@ -11,7 +13,7 @@ using Microsoft::WRL::ComPtr;
|
||||
namespace XCEngine {
|
||||
namespace RHI {
|
||||
|
||||
class D3D12DescriptorHeap {
|
||||
class D3D12DescriptorHeap : public IDescriptorHeap {
|
||||
public:
|
||||
D3D12DescriptorHeap();
|
||||
~D3D12DescriptorHeap();
|
||||
@@ -21,11 +23,14 @@ public:
|
||||
|
||||
ID3D12DescriptorHeap* GetDescriptorHeap() const { return m_descriptorHeap.Get(); }
|
||||
|
||||
CPUDescriptorHandle GetCPUDescriptorHandle(uint32_t index) override;
|
||||
GPUDescriptorHandle GetGPUDescriptorHandle(uint32_t index) override;
|
||||
uint32_t GetDescriptorCount() const override;
|
||||
DescriptorType GetType() const override;
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle(uint32_t index) const;
|
||||
D3D12_GPU_DESCRIPTOR_HANDLE GetGPUDescriptorHandle(uint32_t index) const;
|
||||
|
||||
uint32_t GetDescriptorCount() const { return m_numDescriptors; }
|
||||
DescriptorHeapType GetType() const { return m_type; }
|
||||
uint32_t GetDescriptorSize() const { return m_descriptorSize; }
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandleForHeapStart() const;
|
||||
|
||||
@@ -58,5 +58,25 @@ D3D12_GPU_DESCRIPTOR_HANDLE D3D12DescriptorHeap::GetGPUDescriptorHandleForHeapSt
|
||||
return m_descriptorHeap->GetGPUDescriptorHandleForHeapStart();
|
||||
}
|
||||
|
||||
CPUDescriptorHandle D3D12DescriptorHeap::GetCPUDescriptorHandle(uint32_t index) {
|
||||
CPUDescriptorHandle handle;
|
||||
handle.ptr = GetCPUDescriptorHandle(index).ptr;
|
||||
return handle;
|
||||
}
|
||||
|
||||
GPUDescriptorHandle D3D12DescriptorHeap::GetGPUDescriptorHandle(uint32_t index) {
|
||||
GPUDescriptorHandle handle;
|
||||
handle.ptr = GetGPUDescriptorHandle(index).ptr;
|
||||
return handle;
|
||||
}
|
||||
|
||||
DescriptorType D3D12DescriptorHeap::GetType() const {
|
||||
return static_cast<DescriptorType>(m_type);
|
||||
}
|
||||
|
||||
uint32_t D3D12DescriptorHeap::GetDescriptorCount() const {
|
||||
return m_numDescriptors;
|
||||
}
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
|
||||
Reference in New Issue
Block a user