56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <array>
|
|
#include <volk.h>
|
|
|
|
#include <vma/vk_mem_alloc.h>
|
|
|
|
#include <glm/glm.hpp>
|
|
|
|
struct RenderDevice;
|
|
|
|
struct Vertex
|
|
{
|
|
float position[4];
|
|
float color[4];
|
|
};
|
|
|
|
struct MiscData
|
|
{
|
|
struct CameraData
|
|
{
|
|
glm::mat4x4 modelMatrix;
|
|
glm::mat4x4 viewMatrix;
|
|
glm::mat4x4 projectionMatrix;
|
|
};
|
|
|
|
uint64_t previousCounter;
|
|
|
|
VkDescriptorSetLayout descriptorSetLayout;
|
|
VkPipelineLayout pipelineLayout;
|
|
VkPipeline meshPipeline;
|
|
|
|
VkBuffer vertexBuffer;
|
|
VmaAllocation vertexBufferAllocation;
|
|
size_t vertexBufferSize;
|
|
std::array<Vertex, 4> vertices;
|
|
|
|
glm::vec3 cameraPosition;
|
|
glm::vec3 cameraTarget;
|
|
CameraData cameraData;
|
|
VkBuffer cameraUniformBuffer;
|
|
VmaAllocation cameraUniformBufferAllocation;
|
|
size_t cameraUniformBufferSize;
|
|
uint8_t* cameraUniformBufferPtr;
|
|
VkDescriptorPool descriptorPool;
|
|
VkDescriptorSet descriptorSet;
|
|
|
|
VkImageMemoryBarrier2 acquireToRenderBarrier;
|
|
VkDependencyInfo acquireToRenderDependency;
|
|
VkImageMemoryBarrier2 renderToPresentBarrier;
|
|
VkDependencyInfo renderToPresentDependency;
|
|
|
|
void init( RenderDevice const& renderDevice );
|
|
void destroy( RenderDevice const& renderDevice );
|
|
};
|