2022-07-02 08:09:59 +00:00
|
|
|
|
|
|
|
#pragma once
|
2020-05-31 08:53:11 +00:00
|
|
|
|
|
|
|
#include "vulkan/system/vk_objects.h"
|
2022-07-02 08:09:59 +00:00
|
|
|
#include <array>
|
2020-05-31 08:53:11 +00:00
|
|
|
|
2022-07-02 08:09:59 +00:00
|
|
|
class VulkanFrameBuffer;
|
|
|
|
enum class PPFilterMode;
|
|
|
|
enum class PPWrapMode;
|
2020-05-31 08:53:11 +00:00
|
|
|
|
|
|
|
class VkSamplerManager
|
|
|
|
{
|
|
|
|
public:
|
2022-07-02 08:09:59 +00:00
|
|
|
VkSamplerManager(VulkanFrameBuffer* 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-07-02 08:09:59 +00:00
|
|
|
VulkanFrameBuffer* fb = nullptr;
|
|
|
|
std::array<std::unique_ptr<VulkanSampler>, NUMSAMPLERS> mSamplers;
|
|
|
|
std::array<std::unique_ptr<VulkanSampler>, 4> mPPSamplers;
|
|
|
|
};
|