From 18dd6722d1c4b14dfe322b036b6e4fa1281b4712 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Mon, 11 Jan 2021 23:16:49 +0100 Subject: Path tracer write to the swapchain image --- include/vk-renderer.hpp | 18 +++++++----------- include/vulkan-loader.hpp | 1 + 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/vk-renderer.hpp b/include/vk-renderer.hpp index 32d661c..0ca4da4 100644 --- a/include/vk-renderer.hpp +++ b/include/vk-renderer.hpp @@ -31,19 +31,12 @@ struct input_data { uint32_t height; }; -struct path_tracer_data { - struct input_data inputs; - color first_pixel; -}; - class vkrenderer { public: vkrenderer(window& wnd); void compute(const input_data& inputs, size_t width, size_t height); - const color* const output_image(); - private: void create_instance(); @@ -65,11 +58,14 @@ class vkrenderer { void create_semaphores(); + public: + void initialization_frame(); + void select_physical_device(); void select_compute_queue(); - void fill_descriptor_set(const input_data& data, size_t width, size_t height); + void fill_descriptor_set(const input_data& data); uint32_t compute_queue_index; @@ -85,9 +81,9 @@ class vkrenderer { VkCommandBuffer command_buffer; VkDescriptorPool descriptor_pool; - VkDescriptorSet compute_shader_input_set; + VkDescriptorSet compute_shader_set; - VkDescriptorSetLayout compute_shader_input_layout; + VkDescriptorSetLayout compute_shader_layout; VkPipelineLayout compute_pipeline_layout; VkPipeline compute_pipeline; @@ -101,7 +97,7 @@ class vkrenderer { std::vectorswapchain_images_views; uint32_t current_image_index; - struct path_tracer_data* mapped_data; + struct input_data* mapped_data; }; #endif // !__VK_RENDERER_HPP_ diff --git a/include/vulkan-loader.hpp b/include/vulkan-loader.hpp index 66542cf..d993f5a 100644 --- a/include/vulkan-loader.hpp +++ b/include/vulkan-loader.hpp @@ -90,6 +90,7 @@ X(vkCmdDispatch) \ X(vkCmdEndRenderPass) \ X(vkEndCommandBuffer) \ + X(vkResetCommandBuffer) \ X(vkCreateRenderPass) \ X(vkCreateBuffer) \ X(vkCreateImage) \ -- cgit v1.3