49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
#ifndef MESHPIPELINE_H
|
|
#define MESHPIPELINE_H
|
|
|
|
#include <vulkan/vulkan.h>
|
|
#include <memory>
|
|
#include <destrum/Graphics/Pipeline.h>
|
|
|
|
#include <destrum/Graphics/MeshCache.h>
|
|
#include <destrum/Graphics/MaterialCache.h>
|
|
#include <destrum/Graphics/Camera.h>
|
|
#include <destrum/Graphics/Resources/Buffer.h>
|
|
#include <destrum/Graphics/MeshDrawCommand.h>
|
|
|
|
class MeshPipeline {
|
|
public:
|
|
MeshPipeline();
|
|
~MeshPipeline();
|
|
|
|
void init(GfxDevice& gfxDevice, VkFormat drawImageFormat, VkFormat depthImageFormat);
|
|
void draw(VkCommandBuffer cmd,
|
|
VkExtent2D renderExtent,
|
|
const GfxDevice& gfxDevice,
|
|
const MeshCache& meshCache,
|
|
const MaterialCache& materialCache,
|
|
const Camera& camera,
|
|
const GPUBuffer& sceneDataBuffer,
|
|
const std::vector<MeshDrawCommand>& drawCommands,
|
|
const std::vector<std::size_t>& sortedDrawCommands);
|
|
|
|
void cleanup(VkDevice device);
|
|
|
|
|
|
private:
|
|
VkPipelineLayout m_pipelineLayout;
|
|
|
|
std::unique_ptr<Pipeline> m_pipeline;
|
|
|
|
struct PushConstants {
|
|
glm::mat4 transform;
|
|
VkDeviceAddress sceneDataBuffer;
|
|
VkDeviceAddress vertexBuffer;
|
|
std::uint32_t materialId;
|
|
std::uint32_t padding;
|
|
};
|
|
|
|
};
|
|
|
|
#endif //MESHPIPELINE_H
|