11#include "misc/Error.h"
12#include "render/general/resource/GpuResource.h"
13#include "render/directx/descriptors/DirectXDescriptor.h"
14#include "render/directx/descriptors/DirectXDescriptorType.hpp"
17#include "directx/d3dx12.h"
18#include "D3D12MemoryAllocator/include/D3D12MemAlloc.h"
24 using namespace Microsoft::WRL;
26 class DirectXRenderer;
27 class DirectXDescriptorHeap;
28 class DirectXResourceManager;
29 class ContinuousDirectXDescriptorRange;
64 DirectXDescriptorType descriptorType,
65 const std::shared_ptr<ContinuousDirectXDescriptorRange>& pRange =
nullptr,
66 bool bBindDescriptorsToCubemapFaces =
true);
76 std::optional<D3D12_CPU_DESCRIPTOR_HANDLE>
90 DirectXDescriptorType descriptorType,
size_t iCubemapFaceIndex);
100 std::optional<D3D12_GPU_DESCRIPTOR_HANDLE>
139 std::array<std::unique_ptr<DirectXDescriptor>, 6>
177 static std::variant<std::unique_ptr<DirectXResource>,
Error>
create(
180 D3D12MA::Allocator* pMemoryAllocator,
181 const D3D12MA::ALLOCATION_DESC& allocationDesc,
182 const D3D12_RESOURCE_DESC& resourceDesc,
183 const D3D12_RESOURCE_STATES& initialResourceState,
184 std::optional<D3D12_CLEAR_VALUE> resourceClearValue,
214 std::recursive_mutex,
215 std::array<DescriptorsSameType, static_cast<size_t>(DirectXDescriptorType::END)>>
Definition: DirectXDescriptorHeap.h:205
Definition: DirectXDescriptor.h:21
Definition: DirectXResourceManager.h:27
Definition: DirectXResource.h:32
ComPtr< D3D12MA::Allocation > pAllocatedResource
Definition: DirectXResource.h:219
std::optional< D3D12_GPU_DESCRIPTOR_HANDLE > getBindedDescriptorGpuHandle(DirectXDescriptorType descriptorType)
Definition: DirectXResource.cpp:158
ComPtr< ID3D12Resource > pSwapChainBuffer
Definition: DirectXResource.h:225
std::optional< D3D12_CPU_DESCRIPTOR_HANDLE > getBindedDescriptorCpuHandle(DirectXDescriptorType descriptorType)
Definition: DirectXResource.cpp:99
std::optional< D3D12_CPU_DESCRIPTOR_HANDLE > getBindedCubemapFaceDescriptorCpuHandle(DirectXDescriptorType descriptorType, size_t iCubemapFaceIndex)
Definition: DirectXResource.cpp:123
DirectXDescriptor * getDescriptor(DirectXDescriptorType descriptorType)
Definition: DirectXResource.cpp:182
static std::variant< std::unique_ptr< DirectXResource >, Error > create(DirectXResourceManager *pResourceManager, const std::string &sResourceName, D3D12MA::Allocator *pMemoryAllocator, const D3D12MA::ALLOCATION_DESC &allocationDesc, const D3D12_RESOURCE_DESC &resourceDesc, const D3D12_RESOURCE_STATES &initialResourceState, std::optional< D3D12_CLEAR_VALUE > resourceClearValue, size_t iElementSizeInBytes=0, size_t iElementCount=0)
Definition: DirectXResource.cpp:11
ID3D12Resource * pInternalResource
Definition: DirectXResource.h:231
std::optional< Error > bindDescriptor(DirectXDescriptorType descriptorType, const std::shared_ptr< ContinuousDirectXDescriptorRange > &pRange=nullptr, bool bBindDescriptorsToCubemapFaces=true)
Definition: DirectXResource.cpp:213
static std::variant< std::unique_ptr< DirectXResource >, Error > createResourceFromSwapChainBuffer(DirectXResourceManager *pResourceManager, DirectXDescriptorHeap *pRtvHeap, const ComPtr< ID3D12Resource > &pSwapChainBuffer)
Definition: DirectXResource.cpp:76
std::pair< std::recursive_mutex, std::array< DescriptorsSameType, static_cast< size_t >(DirectXDescriptorType::END)> > mtxHeapDescriptors
Definition: DirectXResource.h:216
ID3D12Resource * getInternalResource() const
Definition: DirectXResource.h:112
Definition: GpuResource.h:16
const std::string sResourceName
Definition: GpuResource.h:97
const unsigned int iElementCount
Definition: GpuResource.h:94
const unsigned int iElementSizeInBytes
Definition: GpuResource.h:91