From ab39ab82b4dc60e4a181140dc91ee046e5daa6ea Mon Sep 17 00:00:00 2001 From: ladevieq Date: Sun, 16 Jan 2022 22:03:56 +0100 Subject: Fix barriers --- include/vk-api.hpp | 16 ++++++++-------- include/vk-renderer.hpp | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/vk-api.hpp b/include/vk-api.hpp index 1127bd7..864632e 100644 --- a/include/vk-api.hpp +++ b/include/vk-api.hpp @@ -14,7 +14,7 @@ struct buffer { VkDeviceAddress device_address; }; -struct Pipeline { +struct pipeline { std::vector shader_modules; VkPipeline handle; VkPipelineBindPoint bind_point; @@ -136,9 +136,9 @@ class vkapi { void destroy_framebuffers(std::vector& framebuffers); - Pipeline create_compute_pipeline(const char* shader_name); - Pipeline create_graphics_pipeline(const char* shader_name, VkShaderStageFlagBits shader_stages, VkRenderPass render_pass, std::vector dynamic_states); - void destroy_pipeline(Pipeline &pipeline); + pipeline create_compute_pipeline(const char* shader_name); + pipeline create_graphics_pipeline(const char* shader_name, VkShaderStageFlagBits shader_stages, VkRenderPass render_pass, std::vector dynamic_states); + void destroy_pipeline(pipeline &pipeline); std::vector create_descriptor_sets(VkDescriptorSetLayout descriptor_sets_layout, size_t descriptor_sets_count); @@ -160,13 +160,13 @@ class vkapi { void image_barrier(VkCommandBuffer command_buffer, VkImageLayout src_layout, VkImageLayout dst_layout, VkPipelineStageFlagBits src_stage, VkPipelineStageFlagBits dst_stage, VkAccessFlags src_access, VkAccessFlags dst_access, image image); - void begin_render_pass(VkCommandBuffer command_buffer, VkRenderPass render_pass, VkFramebuffer framebuffer, VkExtent2D size, Pipeline pipeline); + void begin_render_pass(VkCommandBuffer command_buffer, VkRenderPass render_pass, VkFramebuffer framebuffer, VkExtent2D size, pipeline pipeline); void end_render_pass(VkCommandBuffer command_buffer); - void run_compute_pipeline(VkCommandBuffer command_buffer, Pipeline pipeline, size_t group_count_x, size_t group_count_y, size_t group_count_z); + void run_compute_pipeline(VkCommandBuffer command_buffer, pipeline pipeline, size_t group_count_x, size_t group_count_y, size_t group_count_z); - void draw(VkCommandBuffer command_buffer, Pipeline pipeline, uint32_t vertex_count, uint32_t vertex_offset); - void draw(VkCommandBuffer command_buffer, Pipeline pipeline, buffer index_buffer, uint32_t primitive_count, uint32_t indices_offset, uint32_t vertices_offset); + void draw(VkCommandBuffer command_buffer, pipeline pipeline, uint32_t vertex_count, uint32_t vertex_offset); + void draw(VkCommandBuffer command_buffer, pipeline pipeline, buffer index_buffer, uint32_t primitive_count, uint32_t indices_offset, uint32_t vertices_offset); void blit_full(VkCommandBuffer command_buffer, image src_image, image dst_image); diff --git a/include/vk-renderer.hpp b/include/vk-renderer.hpp index 99521a6..2ec9ef8 100644 --- a/include/vk-renderer.hpp +++ b/include/vk-renderer.hpp @@ -54,16 +54,16 @@ class vkrenderer { std::vector command_buffers; - Pipeline compute_pipeline; + pipeline compute_pipeline; buffer staging_buffer; - Pipeline tonemapping_pipeline; + pipeline tonemapping_pipeline; std::vector ui_vertex_buffers; std::vector ui_index_buffers; - Pipeline ui_pipeline; + pipeline ui_pipeline; VkRenderPass render_pass; std::vector framebuffers; @@ -75,7 +75,7 @@ class vkrenderer { swapchain swapchain; const uint32_t min_swapchain_image_count = 3; - const uint32_t virtual_frames_count = 2; + static constexpr uint32_t virtual_frames_count = 2; }; #endif // !__VK_RENDERER_HPP_ -- cgit v1.3