2022-07-02 08:09:59 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-12-11 17:30:01 +00:00
|
|
|
#include <zvulkan/vulkanobjects.h>
|
2022-07-02 08:09:59 +00:00
|
|
|
#include "vulkan/textures/vk_imagetransition.h"
|
|
|
|
#include <list>
|
|
|
|
|
2022-12-11 17:30:01 +00:00
|
|
|
class VulkanRenderDevice;
|
2022-07-02 08:09:59 +00:00
|
|
|
class VkHardwareTexture;
|
|
|
|
class VkMaterial;
|
|
|
|
class VkPPTexture;
|
|
|
|
class VkTextureImage;
|
|
|
|
enum class PPTextureType;
|
|
|
|
class PPTexture;
|
|
|
|
|
|
|
|
class VkTextureManager
|
|
|
|
{
|
|
|
|
public:
|
2022-12-11 17:30:01 +00:00
|
|
|
VkTextureManager(VulkanRenderDevice* fb);
|
2022-07-02 08:09:59 +00:00
|
|
|
~VkTextureManager();
|
|
|
|
|
|
|
|
void Deinit();
|
|
|
|
|
|
|
|
void BeginFrame();
|
|
|
|
|
|
|
|
void SetLightmap(int LMTextureSize, int LMTextureCount, const TArray<uint16_t>& 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);
|
|
|
|
|
2022-12-11 17:30:01 +00:00
|
|
|
VulkanRenderDevice* fb = nullptr;
|
2022-07-02 08:09:59 +00:00
|
|
|
|
|
|
|
std::list<VkHardwareTexture*> Textures;
|
|
|
|
std::list<VkPPTexture*> PPTextures;
|
|
|
|
|
|
|
|
std::unique_ptr<VulkanImage> NullTexture;
|
|
|
|
std::unique_ptr<VulkanImageView> NullTextureView;
|
|
|
|
};
|