lsfg-vk/framegen/include/vk/core/pipeline.hpp
PancakeTAS 7137310e53
refactor: remove default constructors
not sure if this is a good idea, but seeing how I've messed up vector allocations in the past, this might prevent bugs from happening
2025-09-10 17:53:42 +02:00

38 lines
979 B
C++

#pragma once
#include "vk/core/shadermodule.hpp"
#include "vk/core/device.hpp"
#include <vulkan/vulkan_core.h>
#include <memory>
namespace VK::Core {
///
/// C++ wrapper class for a Vulkan pipeline.
///
/// This class manages the lifetime of a Vulkan pipeline.
///
class Pipeline {
public:
///
/// Create a compute pipeline.
///
/// @param device Vulkan device
/// @param shader Shader module to use for the pipeline.
///
/// @throws VK::vulkan_error if object creation fails.
///
Pipeline(const Device& device, const ShaderModule& shader);
/// Get the Vulkan handle.
[[nodiscard]] auto handle() const { return *this->pipeline; }
/// Get the pipeline layout.
[[nodiscard]] auto getLayout() const { return *this->layout; }
private:
std::shared_ptr<VkPipeline> pipeline;
std::shared_ptr<VkPipelineLayout> layout;
};
}