mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2025-10-30 07:01:10 +00:00
46 lines
1.1 KiB
C++
46 lines
1.1 KiB
C++
#ifndef SAMPLER_HPP
|
|
#define SAMPLER_HPP
|
|
|
|
#include "device.hpp"
|
|
|
|
#include <vulkan/vulkan_core.h>
|
|
|
|
#include <memory>
|
|
|
|
namespace LSFG::Core {
|
|
|
|
///
|
|
/// C++ wrapper class for a Vulkan sampler.
|
|
///
|
|
/// This class manages the lifetime of a Vulkan sampler.
|
|
///
|
|
class Sampler {
|
|
public:
|
|
Sampler() noexcept = default;
|
|
|
|
///
|
|
/// Create the sampler.
|
|
///
|
|
/// @param device Vulkan device
|
|
/// @param mode Address mode for the sampler.
|
|
///
|
|
/// @throws LSFG::vulkan_error if object creation fails.
|
|
///
|
|
Sampler(const Device& device, VkSamplerAddressMode mode);
|
|
|
|
/// Get the Vulkan handle.
|
|
[[nodiscard]] auto handle() const { return *this->sampler; }
|
|
|
|
/// Trivially copyable, moveable and destructible
|
|
Sampler(const Sampler&) noexcept = default;
|
|
Sampler& operator=(const Sampler&) noexcept = default;
|
|
Sampler(Sampler&&) noexcept = default;
|
|
Sampler& operator=(Sampler&&) noexcept = default;
|
|
~Sampler() = default;
|
|
private:
|
|
std::shared_ptr<VkSampler> sampler;
|
|
};
|
|
|
|
}
|
|
|
|
#endif // SAMPLER_HPP
|