11#include "render/general/resource/GpuResource.h" 
   13#include "material/TextureFilteringPreference.h" 
   16#include "VulkanMemoryAllocator/include/vk_mem_alloc.h" 
   20    class VulkanResourceManager;
 
   78                    "cubemap view was requested on resource \"{}\" with an out of bounds index " 
   79                    "{} while cubemap view count is {}",
 
  140                Error error(std::format(
 
  141                    "failed to query VmaAllocation of resource \"{}\" because " 
  142                    "this resource is a KTX texture that was loaded via external library " 
  143                    "(accessing VmaAllocation of such object is complicated, if you want " 
  144                    "to access VkDeviceMemory it's a good time to implement such a getter " 
  145                    "because VkDeviceMemory is available for KTX textures)",
 
  171            std::variant<VkBuffer, VkImage> pInternalResource,
 
  173            VmaAllocation pResourceMemory,
 
  189            ktxVulkanTexture ktxTexture,
 
  190            TextureFilteringPreference filteringPreference);
 
  207        static std::variant<std::unique_ptr<VulkanResource>, 
Error> 
create(
 
  210            VmaAllocator pMemoryAllocator,
 
  211            const VkBufferCreateInfo& bufferInfo,
 
  212            const VmaAllocationCreateInfo& allocationInfo,
 
  230        static std::variant<std::unique_ptr<VulkanResource>, 
Error> 
create(
 
  233            VmaAllocator pMemoryAllocator,
 
  234            const VkImageCreateInfo& imageInfo,
 
  235            const VmaAllocationCreateInfo& allocationInfo,
 
  236            std::optional<VkImageAspectFlags> viewDescription,
 
  237            bool bIsCubeMapView = 
false);
 
  250        static std::variant<std::unique_ptr<VulkanResource>, 
Error> 
create(
 
  253            ktxVulkanTexture ktxTexture,
 
  254            TextureFilteringPreference filteringPreference);
 
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:24
std::pair< std::recursive_mutex, VmaAllocation > * getInternalResourceMemory()
Definition: VulkanResource.h:137
bool isStorageResource() const
Definition: VulkanResource.cpp:117
std::pair< std::recursive_mutex, VmaAllocation > mtxResourceMemory
Definition: VulkanResource.h:291
const TextureFilteringPreference textureFilteringPreference
Definition: VulkanResource.h:294
VkImageView pDepthAspectImageView
Definition: VulkanResource.h:281
VkImage getInternalImage() const
Definition: VulkanResource.h:111
VkBuffer getInternalBufferResource() const
Definition: VulkanResource.h:46
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:174
std::vector< VkImageView > vCubeMapViews
Definition: VulkanResource.h:284
std::optional< ktxVulkanTexture > optionalKtxTexture
Definition: VulkanResource.h:257
const bool isUsedAsStorageResource
Definition: VulkanResource.h:297
VkImage pImageResource
Definition: VulkanResource.h:271
VkSampler getTextureSamplerForThisImage() const
Definition: VulkanResource.cpp:119
VkImageView getInternalImageView() const
Definition: VulkanResource.h:58
VkBuffer pBufferResource
Definition: VulkanResource.h:264
VkImageView pImageView
Definition: VulkanResource.h:274
VkImageView getInternalCubemapImageView(size_t iCubemapFaceIndex=0)
Definition: VulkanResource.h:72
VkImageView getInternalImageViewDepthAspect() const
Definition: VulkanResource.h:99