Files
Destrum/destrum/include/destrum/Graphics/Pipelines/MeshPipeline.h
T

78 lines
1.9 KiB
C++

#ifndef MESHPIPELINE_H
#define MESHPIPELINE_H
#include <cstdint>
#include <memory>
#include <vector>
#include <glm/mat4x4.hpp>
#include <vulkan/vulkan.h>
#include <destrum/Graphics/Pipeline.h>
#include <destrum/Graphics/IndirectDrawList.h>
#include <destrum/Graphics/Resources/Buffer.h>
class GfxDevice;
class RenderResources;
class MeshPipeline {
public:
MeshPipeline();
~MeshPipeline();
void init(
GfxDevice& gfxDevice,
RenderResources& resources,
VkFormat drawImageFormat,
VkFormat depthImageFormat);
void drawDepthPrepass(
VkCommandBuffer cmd,
VkExtent2D renderExtent,
const RenderResources& resources,
const GPUBuffer& sceneDataBuffer,
const IndirectDrawList& drawList,
const IndirectDrawList::View& view);
void draw(
VkCommandBuffer cmd,
VkExtent2D renderExtent,
const RenderResources& resources,
const GPUBuffer& sceneDataBuffer,
const IndirectDrawList& drawList,
const IndirectDrawList::View& view);
void cleanup(VkDevice device);
void setRenderWireframe(bool wireframe) {
m_renderWireframe = wireframe;
}
bool getRenderWireframe() const {
return m_renderWireframe;
}
private:
struct PushConstants {
VkDeviceAddress sceneDataBuffer;
VkDeviceAddress instanceBuffer;
};
void drawMeshes(
VkCommandBuffer cmd,
const Pipeline& pipeline,
VkExtent2D renderExtent,
const RenderResources& resources,
const GPUBuffer& sceneDataBuffer,
const IndirectDrawList& drawList,
const IndirectDrawList::View& view);
private:
VkPipelineLayout m_pipelineLayout{VK_NULL_HANDLE};
std::unique_ptr<Pipeline> m_pipeline;
std::unique_ptr<Pipeline> m_depthPrepassPipeline;
bool m_renderWireframe{false};
};
#endif // MESHPIPELINE_H