#pragma once #include "vulkan/system/vk_objects.h" #include "vulkan/textures/vk_imagetransition.h" #include class VulkanFrameBuffer; class VkHardwareTexture; class VkMaterial; class VkPPTexture; class VkTextureImage; enum class PPTextureType; class PPTexture; class VkTextureManager { public: VkTextureManager(VulkanFrameBuffer* fb); ~VkTextureManager(); void Deinit(); void BeginFrame(); void SetLightmap(int LMTextureSize, int LMTextureCount, const TArray& LMTextureData); VkTextureImage* GetTexture(const PPTextureType& type, PPTexture* tex); VkFormat GetTextureFormat(PPTexture* texture); void AddTexture(VkHardwareTexture* texture); void RemoveTexture(VkHardwareTexture* texture); void AddPPTexture(VkPPTexture* texture); void RemovePPTexture(VkPPTexture* texture); VulkanImage* GetNullTexture() { return NullTexture.get(); } VulkanImageView* GetNullTextureView() { return NullTextureView.get(); } VkTextureImage Shadowmap; VkTextureImage Lightmap; private: void CreateNullTexture(); void CreateShadowmap(); void CreateLightmap(); VkPPTexture* GetVkTexture(PPTexture* texture); VulkanFrameBuffer* fb = nullptr; std::list Textures; std::list PPTextures; std::unique_ptr NullTexture; std::unique_ptr NullTextureView; };