45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "forward.hpp"
|
|
#include <vector>
|
|
#include "Allocator.hpp"
|
|
#include <glm/mat4x4.hpp>
|
|
|
|
namespace render::vk {
|
|
class SwapChain;
|
|
class Pipeline;
|
|
|
|
class CommandCenter {
|
|
public:
|
|
CommandCenter(VkDevice, Allocator&, const std::vector<VkImageView>&, const Pipeline&, const PhysicalDeviceInfo&, const renderOptions&);
|
|
~CommandCenter();
|
|
|
|
void updateUBO(uint32_t idx);
|
|
void submitGraphics(uint32_t, VkSemaphore, VkSemaphore, VkFence);
|
|
|
|
void allocate(Allocator&, const std::vector<VkImageView> &, const Pipeline&, VkExtent2D, const renderOptions&);
|
|
void free();
|
|
|
|
private:
|
|
VkDevice device;
|
|
|
|
std::vector<VkFramebuffer> framebuffers;
|
|
|
|
VkQueue graphicsQueue;
|
|
VkCommandPool graphicsPool;
|
|
std::vector<VkCommandBuffer> graphicsBuffers;
|
|
|
|
VkDescriptorPool descriptorPool;
|
|
std::vector<VkDescriptorSet> descriptorSets;
|
|
|
|
Allocator::buffer_info vertexBuffer;
|
|
Allocator::buffer_info indexBuffer;
|
|
Allocator::memory_ptr indexedBufferMemory;
|
|
|
|
glm::mat4 proj;
|
|
std::vector<Allocator::buffer_info> uniformBuffers;
|
|
Allocator::memory_ptr uniformBuffersMemory;
|
|
|
|
bool freed = true;
|
|
};
|
|
} |