43 lines
1011 B
C++
43 lines
1011 B
C++
#ifndef DESTRUM_LINERENDERINGPASS_H
|
|
#define DESTRUM_LINERENDERINGPASS_H
|
|
|
|
#include <cstddef>
|
|
#include <memory>
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
#include <destrum/Graphics/Managers/LineRenderingManager.h>
|
|
#include <destrum/Graphics/Resources/NBuffer.h>
|
|
|
|
class Camera;
|
|
class GfxDevice;
|
|
struct GPUImage;
|
|
class Pipeline;
|
|
|
|
class LineRenderingPass final {
|
|
public:
|
|
void init(GfxDevice& gfxDevice, VkFormat drawImageFormat);
|
|
void draw(
|
|
VkCommandBuffer cmd,
|
|
GfxDevice& gfxDevice,
|
|
const GPUImage& target,
|
|
const Camera& camera,
|
|
LineRenderingManager& lineManager);
|
|
void cleanup(GfxDevice& gfxDevice);
|
|
|
|
private:
|
|
struct LineVertex {
|
|
glm::vec4 position;
|
|
glm::vec4 color;
|
|
};
|
|
|
|
void ensureVertexCapacity(GfxDevice& gfxDevice, std::size_t requiredVertices);
|
|
|
|
VkPipelineLayout pipelineLayout{VK_NULL_HANDLE};
|
|
std::unique_ptr<Pipeline> pipeline;
|
|
NBuffer vertexBuffer;
|
|
std::size_t vertexCapacity{0};
|
|
};
|
|
|
|
#endif // DESTRUM_LINERENDERINGPASS_H
|