Next part of the tutorial where we have a couple compute shaders controlled by ImGUI.

This commit is contained in:
Zed A. Shaw 2025-12-02 13:14:48 -05:00
parent 14f307b1b3
commit a996440c61
7 changed files with 219 additions and 21 deletions

View file

@ -6,6 +6,22 @@
#include <vk_types.h>
#include <vk_descriptors.h>
struct ComputePushConstants {
glm::vec4 data1;
glm::vec4 data2;
glm::vec4 data3;
glm::vec4 data4;
};
struct ComputeEffect {
const char *name;
VkPipeline pipeline;
VkPipelineLayout layout;
ComputePushConstants data;
};
struct DeletionQueue {
std::deque<std::function<void()>> deletors;
@ -85,6 +101,10 @@ public:
struct SDL_Window* _window{ nullptr };
DeletionQueue _mainDeletionQueue;
// imgui shader stuff
std::vector<ComputeEffect> backgroundEffects;
int currentBackgroundEffect{0};
static VulkanEngine& Get();
//initializes everything in the engine
@ -115,4 +135,5 @@ private:
void destroy_swapchain();
void draw_background(VkCommandBuffer cmd);
void draw_imgui(VkCommandBuffer cmd, VkImageView targetImageView);
void render_imgui();
};