66 lines
1.7 KiB
C++
66 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include <array>
|
|
#include <volk.h>
|
|
|
|
#include <vma/vk_mem_alloc.h>
|
|
|
|
#include <DirectXMath.h>
|
|
|
|
struct GlobalMemory;
|
|
struct RenderDevice;
|
|
|
|
struct Vertex
|
|
{
|
|
DirectX::XMFLOAT3 position;
|
|
DirectX::XMFLOAT3 color;
|
|
DirectX::XMFLOAT2 texCoord0;
|
|
};
|
|
|
|
struct MiscData
|
|
{
|
|
struct CameraData
|
|
{
|
|
DirectX::XMMATRIX modelMatrix;
|
|
DirectX::XMMATRIX viewMatrix;
|
|
DirectX::XMMATRIX projectionMatrix;
|
|
};
|
|
|
|
uint64_t previousCounter;
|
|
|
|
VkDescriptorSetLayout descriptorSetLayout;
|
|
VkPipelineLayout pipelineLayout;
|
|
VkPipeline meshPipeline;
|
|
|
|
VkBuffer vertexBuffer;
|
|
VmaAllocation vertexBufferAllocation;
|
|
size_t vertexBufferSize;
|
|
std::array<Vertex, 4> vertices;
|
|
|
|
VkImage texture;
|
|
VmaAllocation textureAllocation;
|
|
VkImageView textureView;
|
|
VkSampler sampler;
|
|
|
|
uint64_t _padding; // TODO: Optimize out?
|
|
|
|
DirectX::XMVECTOR cameraPosition;
|
|
DirectX::XMVECTOR cameraTarget;
|
|
DirectX::XMVECTOR cameraUp;
|
|
CameraData cameraData;
|
|
VkBuffer cameraUniformBuffer;
|
|
VmaAllocation cameraUniformBufferAllocation;
|
|
size_t cameraUniformBufferSize;
|
|
uint8_t* cameraUniformBufferPtr;
|
|
VkDescriptorPool descriptorPool;
|
|
VkDescriptorSet descriptorSet;
|
|
|
|
VkImageMemoryBarrier2 acquireToRenderBarrier;
|
|
VkDependencyInfo acquireToRenderDependency;
|
|
VkImageMemoryBarrier2 renderToPresentBarrier;
|
|
VkDependencyInfo renderToPresentDependency;
|
|
|
|
bool init( RenderDevice const& renderDevice );
|
|
void destroy( RenderDevice const& renderDevice );
|
|
};
|