2022-07-02 08:09:59 +00:00
|
|
|
|
|
|
|
#pragma once
|
2020-05-31 08:53:11 +00:00
|
|
|
|
2022-12-11 17:30:01 +00:00
|
|
|
#include "zvulkan/vulkanobjects.h"
|
2022-07-02 08:09:59 +00:00
|
|
|
#include <array>
|
2020-05-31 08:53:11 +00:00
|
|
|
|
2022-12-11 17:30:01 +00:00
|
|
|
class VulkanRenderDevice;
|
2022-07-02 08:09:59 +00:00
|
|
|
enum class PPFilterMode;
|
|
|
|
enum class PPWrapMode;
|
2020-05-31 08:53:11 +00:00
|
|
|
|
|
|
|
class VkSamplerManager
|
|
|
|
{
|
|
|
|
public:
|
2022-12-11 17:30:01 +00:00
|
|
|
VkSamplerManager(VulkanRenderDevice* fb);
|
2020-05-31 08:53:11 +00:00
|
|
|
~VkSamplerManager();
|
|
|
|
|
2022-07-02 08:09:59 +00:00
|
|
|
void ResetHWSamplers();
|
2020-05-31 08:53:11 +00:00
|
|
|
|
|
|
|
VulkanSampler *Get(int no) const { return mSamplers[no].get(); }
|
2022-07-02 08:09:59 +00:00
|
|
|
VulkanSampler* Get(PPFilterMode filter, PPWrapMode wrap);
|
2020-05-31 08:53:11 +00:00
|
|
|
|
2022-07-02 08:09:59 +00:00
|
|
|
std::unique_ptr<VulkanSampler> ShadowmapSampler;
|
|
|
|
std::unique_ptr<VulkanSampler> LightmapSampler;
|
2020-05-31 08:53:11 +00:00
|
|
|
|
2022-07-02 08:09:59 +00:00
|
|
|
private:
|
|
|
|
void CreateHWSamplers();
|
|
|
|
void DeleteHWSamplers();
|
|
|
|
void CreateShadowmapSampler();
|
|
|
|
void CreateLightmapSampler();
|
2020-05-31 08:53:11 +00:00
|
|
|
|
2022-12-11 17:30:01 +00:00
|
|
|
VulkanRenderDevice* fb = nullptr;
|
2022-07-02 08:09:59 +00:00
|
|
|
std::array<std::unique_ptr<VulkanSampler>, NUMSAMPLERS> mSamplers;
|
|
|
|
std::array<std::unique_ptr<VulkanSampler>, 4> mPPSamplers;
|
|
|
|
};
|