51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "forward.hpp"
|
|
#include <vector>
|
|
#include <glm/mat4x4.hpp>
|
|
#include "api/Buffers.hpp"
|
|
#include "api/Images.hpp"
|
|
|
|
namespace render::vk {
|
|
class SwapChain;
|
|
class Pipeline;
|
|
|
|
class CommandCenter final {
|
|
public:
|
|
CommandCenter(VkDevice, const PhysicalDeviceInfo&, const renderOptions&);
|
|
~CommandCenter();
|
|
|
|
void updateUBO(uint32_t idx);
|
|
void submitGraphics(uint32_t, VkSemaphore, VkSemaphore, VkFence);
|
|
|
|
void allocate(const std::vector<VkImageView>&, const Pipeline&, VkExtent2D, const renderOptions&);
|
|
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;
|
|
|
|
glm::mat4 proj;
|
|
BufferGroup uniformBuffers;
|
|
|
|
bool freed = true;
|
|
};
|
|
} |