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"
15#include "material/TextureFilteringPreference.h"
18#include "directx/d3dx12.h"
19#include "D3D12MemoryAllocator/include/D3D12MemAlloc.h"
25 using namespace Microsoft::WRL;
27 class DirectXRenderer;
28 class DirectXDescriptorHeap;
29 class DirectXResourceManager;
30 class ContinuousDirectXDescriptorRange;
65 DirectXDescriptorType descriptorType,
66 const std::shared_ptr<ContinuousDirectXDescriptorRange>& pRange =
nullptr,
67 bool bBindDescriptorsToCubemapFaces =
true);
77 std::optional<D3D12_CPU_DESCRIPTOR_HANDLE>
91 DirectXDescriptorType descriptorType,
size_t iCubemapFaceIndex);
101 std::optional<D3D12_GPU_DESCRIPTOR_HANDLE>
149 std::array<std::unique_ptr<DirectXDescriptor>, 6>
170 TextureFilteringPreference filteringPreference =
171 TextureFilteringPreference::FROM_RENDER_SETTINGS);
193 static std::variant<std::unique_ptr<DirectXResource>,
Error>
create(
196 D3D12MA::Allocator* pMemoryAllocator,
197 const D3D12MA::ALLOCATION_DESC& allocationDesc,
198 const D3D12_RESOURCE_DESC& resourceDesc,
199 const D3D12_RESOURCE_STATES& initialResourceState,
200 std::optional<D3D12_CLEAR_VALUE> resourceClearValue,
203 TextureFilteringPreference filteringPreference =
204 TextureFilteringPreference::FROM_RENDER_SETTINGS);
232 std::recursive_mutex,
233 std::array<DescriptorsSameType, static_cast<size_t>(DirectXDescriptorType::END)>>
Definition: DirectXDescriptorHeap.h:206
Definition: DirectXDescriptor.h:21
Definition: DirectXResourceManager.h:28
Definition: DirectXResource.h:33
ComPtr< D3D12MA::Allocation > pAllocatedResource
Definition: DirectXResource.h:237
std::optional< D3D12_GPU_DESCRIPTOR_HANDLE > getBindedDescriptorGpuHandle(DirectXDescriptorType descriptorType)
Definition: DirectXResource.cpp:160
ComPtr< ID3D12Resource > pSwapChainBuffer
Definition: DirectXResource.h:243
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, TextureFilteringPreference filteringPreference=TextureFilteringPreference::FROM_RENDER_SETTINGS)
Definition: DirectXResource.cpp:11
std::optional< D3D12_CPU_DESCRIPTOR_HANDLE > getBindedDescriptorCpuHandle(DirectXDescriptorType descriptorType)
Definition: DirectXResource.cpp:101
std::optional< D3D12_CPU_DESCRIPTOR_HANDLE > getBindedCubemapFaceDescriptorCpuHandle(DirectXDescriptorType descriptorType, size_t iCubemapFaceIndex)
Definition: DirectXResource.cpp:125
TextureFilteringPreference getTextureFilteringPreference() const
Definition: DirectXResource.h:132
DirectXDescriptor * getDescriptor(DirectXDescriptorType descriptorType)
Definition: DirectXResource.cpp:184
const TextureFilteringPreference textureFilteringPreference
Definition: DirectXResource.h:252
ID3D12Resource * pInternalResource
Definition: DirectXResource.h:249
std::optional< Error > bindDescriptor(DirectXDescriptorType descriptorType, const std::shared_ptr< ContinuousDirectXDescriptorRange > &pRange=nullptr, bool bBindDescriptorsToCubemapFaces=true)
Definition: DirectXResource.cpp:217
static std::variant< std::unique_ptr< DirectXResource >, Error > createResourceFromSwapChainBuffer(DirectXResourceManager *pResourceManager, DirectXDescriptorHeap *pRtvHeap, const ComPtr< ID3D12Resource > &pSwapChainBuffer)
Definition: DirectXResource.cpp:78
std::pair< std::recursive_mutex, std::array< DescriptorsSameType, static_cast< size_t >(DirectXDescriptorType::END)> > mtxHeapDescriptors
Definition: DirectXResource.h:234
ID3D12Resource * getInternalResource() const
Definition: DirectXResource.h:113
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