9#include "render/directx/descriptors/DirectXDescriptorHeap.h"
10#include "render/general/resource/GpuResourceManager.h"
13#include "directx/d3dx12.h"
14#include "D3D12MemoryAllocator/include/D3D12MemAlloc.h"
20 using namespace Microsoft::WRL;
22 class DirectXResource;
23 class DirectXRenderer;
52 static std::variant<std::unique_ptr<DirectXResourceManager>,
Error>
64 const std::string& sResourceName,
const std::filesystem::path& pathToTextureFile)
override;
98 const std::string& sResourceName,
99 size_t iElementSizeInBytes,
100 size_t iElementCount,
101 std::optional<bool> isUsedInShadersAsArrayResource)
override;
129 const std::string& sResourceName,
130 const void* pBufferData,
131 size_t iElementSizeInBytes,
132 size_t iElementCount,
133 ResourceUsageType usage,
134 bool bIsShaderReadWriteResource)
override;
152 const std::string& sResourceName,
153 size_t iElementSizeInBytes,
154 size_t iElementCount,
155 ResourceUsageType usage,
156 bool bIsShaderReadWriteResource)
override;
169 const std::string& sResourceName,
171 unsigned int iHeight,
172 ShaderReadWriteTextureResourceFormat format)
override;
200 const std::string& sResourceName,
201 const D3D12MA::ALLOCATION_DESC& allocationDesc,
202 const D3D12_RESOURCE_DESC& resourceDesc,
203 const D3D12_RESOURCE_STATES& initialResourceState,
204 const std::optional<D3D12_CLEAR_VALUE>& resourceClearValue);
215 std::variant<std::vector<std::unique_ptr<DirectXResource>>,
Error>
259 std::unique_ptr<DirectXDescriptorHeap>&&
pRtvHeap,
260 std::unique_ptr<DirectXDescriptorHeap>&&
pDsvHeap,
287 return (iNumber + 255) & ~255;
302 const std::string& sResourceName,
303 unsigned int iTextureSize,
304 bool bPointLightColorCubemap)
override;
321 const std::string& sResourceName,
322 const D3D12_RESOURCE_DESC& finalResourceDescription,
323 const std::vector<D3D12_SUBRESOURCE_DATA>& vSubresourcesToCopy,
324 const D3D12_RESOURCE_DESC& uploadResourceDescription,
325 bool bIsTextureResource,
326 size_t iElementSizeInBytes = 0,
327 size_t iElementCount = 0);
Definition: DirectXDescriptorHeap.h:211
Definition: DirectXRenderer.h:36
Definition: DirectXResourceManager.h:27
static std::variant< std::unique_ptr< DirectXResourceManager >, Error > create(DirectXRenderer *pRenderer)
Definition: DirectXResourceManager.cpp:16
virtual std::variant< std::unique_ptr< UploadBuffer >, Error > createResourceWithCpuWriteAccess(const std::string &sResourceName, size_t iElementSizeInBytes, size_t iElementCount, std::optional< bool > isUsedInShadersAsArrayResource) override
Definition: DirectXResourceManager.cpp:182
ComPtr< D3D12MA::Allocator > pMemoryAllocator
Definition: DirectXResourceManager.h:330
virtual std::variant< std::unique_ptr< GpuResource >, Error > createShaderReadWriteTextureResource(const std::string &sResourceName, unsigned int iWidth, unsigned int iHeight, ShaderReadWriteTextureResourceFormat format) override
Definition: DirectXResourceManager.cpp:296
DirectXDescriptorHeap * getRtvHeap() const
Definition: DirectXResourceManager.cpp:466
static DXGI_FORMAT convertTextureResourceFormatToDxFormat(ShaderReadWriteTextureResourceFormat format)
Definition: DirectXResourceManager.cpp:531
DirectXDescriptorHeap * getDsvHeap() const
Definition: DirectXResourceManager.cpp:468
DirectXDescriptorHeap * getCbvSrvUavHeap() const
Definition: DirectXResourceManager.cpp:470
std::unique_ptr< DirectXDescriptorHeap > pRtvHeap
Definition: DirectXResourceManager.h:333
std::unique_ptr< DirectXDescriptorHeap > pCbvSrvUavHeap
Definition: DirectXResourceManager.h:339
std::unique_ptr< DirectXDescriptorHeap > pDsvHeap
Definition: DirectXResourceManager.h:336
virtual std::variant< std::unique_ptr< GpuResource >, Error > loadTextureFromDisk(const std::string &sResourceName, const std::filesystem::path &pathToTextureFile) override
Definition: DirectXResourceManager.cpp:66
virtual size_t getUsedVideoMemoryInMb() const override
Definition: DirectXResourceManager.cpp:412
virtual std::string getCurrentStateInfo() override
Definition: DirectXResourceManager.cpp:472
virtual std::variant< std::unique_ptr< GpuResource >, Error > createResource(const std::string &sResourceName, size_t iElementSizeInBytes, size_t iElementCount, ResourceUsageType usage, bool bIsShaderReadWriteResource) override
Definition: DirectXResourceManager.cpp:257
virtual std::variant< std::unique_ptr< GpuResource >, Error > createResourceWithData(const std::string &sResourceName, const void *pBufferData, size_t iElementSizeInBytes, size_t iElementCount, ResourceUsageType usage, bool bIsShaderReadWriteResource) override
Definition: DirectXResourceManager.cpp:220
virtual std::variant< std::unique_ptr< GpuResource >, Error > createShadowMapTexture(const std::string &sResourceName, unsigned int iTextureSize, bool bPointLightColorCubemap) override
Definition: DirectXResourceManager.cpp:335
virtual size_t getTotalVideoMemoryInMb() const override
Definition: DirectXResourceManager.cpp:405
static size_t makeMultipleOf256(size_t iNumber)
Definition: DirectXResourceManager.h:276
std::variant< std::vector< std::unique_ptr< DirectXResource > >, Error > makeRtvResourcesFromSwapChainBuffer(IDXGISwapChain3 *pSwapChain, unsigned int iSwapChainBufferCount)
Definition: DirectXResourceManager.cpp:443
Definition: GpuResourceManager.h:43
Renderer *const pRenderer
Definition: GpuResourceManager.h:300