aboutsummaryrefslogtreecommitdiffstats
path: root/include/vk-renderer.hpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2022-07-09 23:45:26 +0200
committerladevieq <ladevie.quentin@gmail.com>2022-07-10 00:04:17 +0200
commitcfcb5c3212f0fce667885ff0de6fa0b9fc4b3ca8 (patch)
treed076b243e0203537d5816c9a15010723581d7f97 /include/vk-renderer.hpp
parent928b1b0503d2ecab09cc275e9775593a41e417cb (diff)
Improve compilation time
Diffstat (limited to 'include/vk-renderer.hpp')
-rw-r--r--include/vk-renderer.hpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/include/vk-renderer.hpp b/include/vk-renderer.hpp
index 864bc48..a301a5b 100644
--- a/include/vk-renderer.hpp
+++ b/include/vk-renderer.hpp
@@ -1,8 +1,6 @@
#ifndef __VK_RENDERER_HPP_
#define __VK_RENDERER_HPP_
-#include <stdint.h>
-#include <sys/types.h>
#include <vector>
#include "vk-api.hpp"
@@ -26,8 +24,6 @@ class vkrenderer {
void begin_frame();
- void compute(uint32_t width, uint32_t height);
-
void finish_frame();
void recreate_swapchain();
@@ -52,19 +48,23 @@ class vkrenderer {
void render();
- uint32_t frame_index() { return this->virtual_frame_index; }
+ [[nodiscard]]uint32_t frame_index() const { return this->virtual_frame_index; }
- Texture* back_buffer() { return swapchain_textures[swapchain_image_index]; }
+ [[nodiscard]]Texture* back_buffer() const { return swapchain_textures[swapchain_image_index]; }
- VkFormat back_buffer_format() { return swapchain.surface_format.format; }
+ [[nodiscard]]VkFormat back_buffer_format() const { return swapchain.surface_format.format; }
static constexpr uint32_t virtual_frames_count = 2;
+ vkcontext context;
+
+ vkapi api;
+
private:
void handle_swapchain_result(VkResult function_result);
- vkapi api;
+ // vkapi api;
std::vector<Renderpass*> renderpasses;
@@ -78,9 +78,9 @@ class vkrenderer {
pipeline tonemapping_pipeline;
- std::vector<VkFence> submission_fences;
- std::vector<VkSemaphore> execution_semaphores;
- std::vector<VkSemaphore> acquire_semaphores;
+ VkFence submission_fences[virtual_frames_count];
+ VkSemaphore execution_semaphores[virtual_frames_count];
+ VkSemaphore acquire_semaphores[virtual_frames_count];
VkSurfaceKHR platform_surface;
swapchain swapchain;