11#include "render/general/resource/GpuResource.h"
15#include "VulkanMemoryAllocator/include/vk_mem_alloc.h"
19 class VulkanResourceManager;
77 "cubemap view was requested on resource \"{}\" with an out of bounds index "
78 "{} while cubemap view count is {}",
131 Error error(std::format(
132 "failed to query VmaAllocation of resource \"{}\" because "
133 "this resource is a KTX texture that was loaded via external library "
134 "(accessing VmaAllocation of such object is complicated, if you want "
135 "to access VkDeviceMemory it's a good time to implement such a getter "
136 "because VkDeviceMemory is available for KTX textures)",
162 std::variant<VkBuffer, VkImage> pInternalResource,
164 VmaAllocation pResourceMemory,
179 ktxVulkanTexture ktxTexture);
196 static std::variant<std::unique_ptr<VulkanResource>,
Error>
create(
199 VmaAllocator pMemoryAllocator,
200 const VkBufferCreateInfo& bufferInfo,
201 const VmaAllocationCreateInfo& allocationInfo,
219 static std::variant<std::unique_ptr<VulkanResource>,
Error>
create(
222 VmaAllocator pMemoryAllocator,
223 const VkImageCreateInfo& imageInfo,
224 const VmaAllocationCreateInfo& allocationInfo,
225 std::optional<VkImageAspectFlags> viewDescription,
226 bool bIsCubeMapView =
false);
238 static std::variant<std::unique_ptr<VulkanResource>,
Error>
create(
241 ktxVulkanTexture ktxTexture);
std::string getFullErrorMessage() const
Definition: Error.cpp:84
void showError() const
Definition: Error.cpp:102
Definition: GpuResource.h:16
const std::string sResourceName
Definition: GpuResource.h:97
std::string getResourceName() const
Definition: GpuResource.cpp:30
const unsigned int iElementCount
Definition: GpuResource.h:94
const unsigned int iElementSizeInBytes
Definition: GpuResource.h:91
void error(std::string_view sText, const std::source_location location=std::source_location::current()) const
Definition: Logger.cpp:75
static Logger & get()
Definition: Logger.cpp:41
Definition: VulkanResourceManager.h:18
Definition: VulkanResource.h:23
std::pair< std::recursive_mutex, VmaAllocation > * getInternalResourceMemory()
Definition: VulkanResource.h:128
bool isStorageResource() const
Definition: VulkanResource.cpp:114
std::pair< std::recursive_mutex, VmaAllocation > mtxResourceMemory
Definition: VulkanResource.h:278
VkImageView pDepthAspectImageView
Definition: VulkanResource.h:268
VkImage getInternalImage() const
Definition: VulkanResource.h:110
VkBuffer getInternalBufferResource() const
Definition: VulkanResource.h:45
static std::variant< std::unique_ptr< VulkanResource >, Error > create(VulkanResourceManager *pResourceManager, const std::string &sResourceName, VmaAllocator pMemoryAllocator, const VkBufferCreateInfo &bufferInfo, const VmaAllocationCreateInfo &allocationInfo, unsigned int iElementSizeInBytes, unsigned int iElementCount)
Definition: VulkanResource.cpp:116
std::vector< VkImageView > vCubeMapViews
Definition: VulkanResource.h:271
std::optional< ktxVulkanTexture > optionalKtxTexture
Definition: VulkanResource.h:244
const bool isUsedAsStorageResource
Definition: VulkanResource.h:281
VkImage pImageResource
Definition: VulkanResource.h:258
VkImageView getInternalImageView() const
Definition: VulkanResource.h:57
VkBuffer pBufferResource
Definition: VulkanResource.h:251
VkImageView pImageView
Definition: VulkanResource.h:261
VkImageView getInternalCubemapImageView(size_t iCubemapFaceIndex=0)
Definition: VulkanResource.h:71
VkImageView getInternalImageViewDepthAspect() const
Definition: VulkanResource.h:98