PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
graphics_frame_helpers_internal.h
1#pragma once
2
3#include "pixelbullet/graphics/render_target.h"
4
5#include <map>
6#include <memory>
7#include <optional>
8#include <string>
9#include <string_view>
10#include <vector>
11
12namespace pixelbullet
13{
14class ImageDepth;
15class RenderDevice;
17class RenderTarget2D;
18
19namespace graphics_frame_internal
20{
21enum class PrepareFrameAction
22{
23 Skip,
24 StartRenderer,
25 RebuildStages,
26 AcquireImage,
27};
28
29enum class PrepareFrameAcquireAction
30{
31 RebuildStages,
32 Continue,
33 SkipFrame,
34};
35
36enum class RenderPreparedFrameAction
37{
38 SkipFrame,
39 ReturnRendered,
40 ReturnSkipped,
41};
42
43const RenderStageRuntime* FindSwapchainRenderStage(const RenderDevice& render_device) noexcept;
44const ImageDepth* FindDepthAttachment(const std::vector<std::unique_ptr<RenderStageRuntime>>& render_stage_runtimes,
45 std::string_view name) noexcept;
46std::optional<RenderTargetView> FindRenderTargetView(const std::map<std::string, std::unique_ptr<RenderTarget2D>>& render_targets,
47 std::string_view name);
48
49PrepareFrameAction BuildPrepareFrameAction(bool has_renderer, bool window_minimized, bool renderer_started, bool rebuild_stages) noexcept;
50PrepareFrameAcquireAction ResolvePrepareFrameAcquireAction(VkResult result) noexcept;
51RenderPreparedFrameAction ResolveRenderPreparedFrameAction(bool prepared_frame_ready, bool has_renderer, bool window_minimized,
52 bool rendered_swapchain_frame) noexcept;
53bool RequiresSwapchainRebuild(bool framebuffer_resized, const VkExtent2D& current_extent, const VkExtent2D& display_extent) noexcept;
54bool RequiresSwapchainRebuildAfterAcquire(VkResult result) noexcept;
55bool IsSuccessfulAcquireResult(VkResult result) noexcept;
56bool ShouldWaitForImageFence(VkFence image_fence, VkFence current_flight_fence) noexcept;
57bool RequiresFramebufferResizeAfterPresent(VkResult result) noexcept;
58bool ShouldAdvanceFrameAfterPresent(VkResult result) noexcept;
59} // namespace graphics_frame_internal
60} // namespace pixelbullet
Definition render_device.h:15
Definition render_stage_runtime.h:27
Definition render_target_internal.h:15