64 lines
1.6 KiB
C++
64 lines
1.6 KiB
C++
|
#pragma once
|
||
|
|
||
|
#include <vk.hpp>
|
||
|
#include <glm/glm.hpp>
|
||
|
#include <component.hpp>
|
||
|
|
||
|
struct DebugImage
|
||
|
{
|
||
|
VkImage image;
|
||
|
VkDeviceMemory memory;
|
||
|
VkImageView view;
|
||
|
VkSampler sampler;
|
||
|
|
||
|
VkDescriptorSet descriptorSet;
|
||
|
|
||
|
VkBuffer uniformMatrixBuffer, uniformDebugBuffer;
|
||
|
VkDeviceMemory uniformMatrixBufferMemory, uniformDebugBufferMemory;
|
||
|
};
|
||
|
|
||
|
class DebugPass
|
||
|
{
|
||
|
public:
|
||
|
void Initialize(VkRenderPass renderPass, vk::Device device);
|
||
|
void Record(Camera* camera, VkCommandBuffer buffer, vk::Device device);
|
||
|
void Cleanup(vk::Device device);
|
||
|
|
||
|
void CreateDebugImage(const char* filepath, DebugImage& image, vk::Device device);
|
||
|
void DestroyDebugImage(DebugImage& image, vk::Device device);
|
||
|
|
||
|
void UploadUniformData(int index,
|
||
|
glm::vec3 position,
|
||
|
glm::vec3 color,
|
||
|
Camera* camera,
|
||
|
VkDeviceMemory matrixMemory,
|
||
|
VkDeviceMemory debugMemory,
|
||
|
uint32_t offsets[2],
|
||
|
vk::Device device);
|
||
|
|
||
|
VkShaderModule vertexShaderModule, fragmentShaderModule;
|
||
|
|
||
|
struct UniformMatrixData
|
||
|
{
|
||
|
glm::mat4 view;
|
||
|
glm::mat4 proj;
|
||
|
glm::mat4 model;
|
||
|
glm::vec4 color;
|
||
|
} matrixData[10];
|
||
|
|
||
|
struct UniformDebugData
|
||
|
{
|
||
|
glm::vec4 color;
|
||
|
glm::vec3 dummy;
|
||
|
int dummy2;
|
||
|
};
|
||
|
|
||
|
DebugImage lightImage, cameraImage;
|
||
|
|
||
|
VkDescriptorSetLayout descriptorSetLayout;
|
||
|
|
||
|
VkPipeline pipeline;
|
||
|
VkPipelineLayout pipelineLayout;
|
||
|
|
||
|
VkDescriptorPool descriptorPool;
|
||
|
};
|