Blaze/MiscData.h

74 lines
1.9 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 Transform
{
DirectX::XMFLOAT3 position;
float scale;
DirectX::XMVECTOR rotation;
};
struct MiscData
{
struct CameraData
{
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?
std::array<Transform, 2> modelTransform;
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 );
};