60 lines
1.5 KiB
C++
60 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include "forward.hpp"
|
|
#include <vector>
|
|
#include <glm/mat4x4.hpp>
|
|
#include "api/Buffers.hpp"
|
|
#include "api/Images.hpp"
|
|
#include "api/Models.hpp"
|
|
|
|
namespace render::vk {
|
|
class SwapChain;
|
|
class Pipeline;
|
|
|
|
class CommandCenter final {
|
|
public:
|
|
CommandCenter(VkDevice, const PhysicalDeviceInfo&, const renderOptions&);
|
|
~CommandCenter();
|
|
|
|
void startRecording(uint32_t idx);
|
|
void startWorldPass(uint32_t idx, const Pipeline &, VkExtent2D, const glm::vec4 &clear);
|
|
void recordModel(uint32_t idx);
|
|
void startEntityPass(uint32_t idx);
|
|
//void recordModel(uint32_t idx);
|
|
void recordPostprocess(uint32_t idx);
|
|
void submitGraphics(uint32_t, VkSemaphore, VkSemaphore, VkFence);
|
|
|
|
void allocate(const std::vector<VkImageView>&, const Pipeline&, VkExtent2D);
|
|
void free();
|
|
|
|
private:
|
|
VkDevice device;
|
|
|
|
std::vector<VkFramebuffer> framebuffers;
|
|
|
|
VkFormat colorFormat;
|
|
VkSampleCountFlagBits colorSamples;
|
|
std::unique_ptr<Image> colorbuffer;
|
|
VkFormat depthFormat;
|
|
std::unique_ptr<Image> depthbuffer;
|
|
|
|
VkQueue graphicsQueue;
|
|
VkCommandPool graphicsPool;
|
|
std::vector<VkCommandBuffer> graphicsBuffers;
|
|
|
|
VkDescriptorPool descriptorPool;
|
|
std::vector<VkDescriptorSet> descriptorSets;
|
|
|
|
std::unique_ptr<ShortIndexedVertexBuffer> modelBuffer;
|
|
|
|
std::unique_ptr<Texture> sampleTexture;
|
|
|
|
std::unique_ptr<TextureCube> skyboxTexture;
|
|
std::unique_ptr<Shape> skyCubeBuffer;
|
|
|
|
glm::mat4 proj;
|
|
BufferGroup uniformBuffers;
|
|
|
|
bool freed = true;
|
|
};
|
|
} |