refactor: move all caches to RenderResources object

This commit is contained in:
2026-06-29 04:08:57 +02:00
parent 3bc8ba02e1
commit aa5c497f29
27 changed files with 1187 additions and 692 deletions
@@ -1,27 +1,36 @@
#ifndef MESHPIPELINE_H
#define MESHPIPELINE_H
#include <vulkan/vulkan.h>
#include <cstdint>
#include <memory>
#include <destrum/Graphics/Pipeline.h>
#include <vector>
#include <destrum/Graphics/MeshCache.h>
#include <destrum/Graphics/MaterialCache.h>
#include <glm/mat4x4.hpp>
#include <vulkan/vulkan.h>
#include <destrum/Graphics/Pipeline.h>
#include <destrum/Graphics/Camera.h>
#include <destrum/Graphics/Resources/Buffer.h>
#include <destrum/Graphics/MeshDrawCommand.h>
class GfxDevice;
class RenderResources;
class MeshPipeline {
public:
MeshPipeline();
~MeshPipeline();
void init(GfxDevice& gfxDevice, VkFormat drawImageFormat, VkFormat depthImageFormat);
void draw(VkCommandBuffer cmd,
void init(
GfxDevice& gfxDevice,
RenderResources& resources,
VkFormat drawImageFormat,
VkFormat depthImageFormat);
void draw(
VkCommandBuffer cmd,
VkExtent2D renderExtent,
const GfxDevice& gfxDevice,
const MeshCache& meshCache,
const MaterialCache& materialCache,
const RenderResources& resources,
const Camera& camera,
const GPUBuffer& sceneDataBuffer,
const std::vector<MeshDrawCommand>& drawCommands,
@@ -33,14 +42,11 @@ public:
m_renderWireframe = wireframe;
}
bool getRenderWireframe(){ return m_renderWireframe; }
bool getRenderWireframe() const {
return m_renderWireframe;
}
private:
VkPipelineLayout m_pipelineLayout;
std::unique_ptr<Pipeline> m_pipeline;
struct PushConstants {
glm::mat4 transform;
VkDeviceAddress sceneDataBuffer;
@@ -49,8 +55,11 @@ private:
std::uint32_t padding;
};
bool m_renderWireframe{false};
private:
VkPipelineLayout m_pipelineLayout{VK_NULL_HANDLE};
std::unique_ptr<Pipeline> m_pipeline;
bool m_renderWireframe{false};
};
#endif //MESHPIPELINE_H
#endif // MESHPIPELINE_H