33#include "VulkanDefines.h"
34#include "VulkanImage.h"
35#include "VulkanRenderDefinition.h"
36#include "ImageResources.h"
38#include "NDEVRGraphics/Headers/GraphicsPipeline.h"
39#include "Base/Headers/String.h"
40#include "Base/Headers/Pointer.hpp"
41#include "Base/Headers/Buffer.hpp"
44 struct SwapChainSupportDetails;
51 struct SwapChainSupportDetails;
76 PrimitiveBuffer<VkSurfaceFormatKHR>
formats;
81 VulkanRenderPipeline(
const VulkanRenderPipeline& pipeline) =
delete;
82 virtual ~VulkanRenderPipeline();
94 void invalidateImages();
99 void setSwapChainImageFormat(VkFormat format);
104 void setGrabImage(
Image* image);
106 void setClearColor(
const RGBColor& color);
109 void ensureFinished(
uint04 frame_index);
112 virtual void cleanupSwapChainResources(
bool clean_khr);
113 virtual void cleanupKHR();
118 bool needsSurfaceUpdate()
const;
120 virtual void createKHRImages(
uint04 multisample_count);
121 void createGrabImages(
uint04 multisample_count);
122 static fltp08 ScreenSizeAllocationFactor();
123 [[nodiscard]] PrimitiveBuffer<VkClearValue> clearValues()
const;
125 VkSurfaceFormatKHR chooseSwapSurfaceFormat(
const PrimitiveBuffer<VkSurfaceFormatKHR>& availableFormats);
130 void createCommandBuffers();
The equivelent of std::vector but with a bit more control.
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
A GraphicsPipeline is a set of resources that are chained together to correctly render something.
Options that are used for performing an update on a Graphics Engine call.
A root class that stores an an array of pixel data that can be displayed as an Image.
Serves as the primary program interface for processes to report issues and allows any number of LogSt...
Represents a color in the RGB space with optional alpha transparency.
Represents a timestamp with utilities for manipulation and conversion.
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Creates specific information for performing a render pass within Vulkan.
RGBColor m_clear_color
The clear color for the render pass.
Buffer< VulkanImageResources > m_frames
Per-frame image resources.
void ensureLastRenderComplete() override
Blocks until the last submitted render is complete.
Image * m_grab_image
The CPU-side image for frame readback.
virtual const ConstPointer< GraphicsDevice > & device() const override
Returns the graphics device (const).
VkQueue_T * m_present_queue
The Vulkan queue used for presentation.
DynamicPointer< VulkanImageData > m_multisample_image_color
Multisample color resolve image.
bool m_needs_grab_image
Whether a grab image readback is pending.
DynamicPointer< VulkanImageData > m_depth_image
Depth buffer image.
ConstPointer< SwapChainSupportDetails > m_swap_chain_support_details
Cached swap chain support details.
Vector< 2, uint04 > m_draw_size
The current draw dimensions in pixels.
DynamicPointer< VulkanImageView > m_shadow_view
View for the shadow map.
DynamicPointer< VulkanDevice > m_device
The Vulkan device for this pipeline.
virtual void commit(GraphicsUpdateArguments &) override
Commits pending changes to the GPU.
uint04 m_pipeline_acquire
The current acquire index for semaphore cycling.
uint04 m_number_of_khr_images
The number of KHR swap chain images.
bool createPipeline(GraphicsUpdateArguments &args) override
Creates or recreates the rendering pipeline.
void setWindowInstance(WindowInstance *instance) override
Associates a window instance with this pipeline.
DynamicPointer< VulkanImageData > m_shadow_image
Shadow map image.
DynamicPointer< VulkanImageView > m_depth_view
View for the depth buffer.
const DynamicPointer< GraphicsDevice > & device() override
Returns the graphics device.
void cleanup() override
Releases all GPU resources.
WindowInstance * m_window_instance
The window instance this pipeline renders to.
DynamicPointer< VulkanRenderDefinition > m_render_definition
The render pass definition.
uint08 m_khr_format
The KHR swap chain image format as an integer.
VkSwapchainKHR m_khr_swap_chain
The KHR swap chain handle.
Time m_surface_update_time
The last time the surface was updated.
bool runCommand(GraphicsUpdateArguments &args) override
Executes a queued rendering command.
void init(GraphicsUpdateArguments &args) override
Initializes the pipeline with the given arguments.
uint04 m_number_of_grab_images
The number of grab image resources.
virtual void updateUniformBuffer(GraphicsUpdateArguments &) override
Updates the camera uniform buffer on the GPU.
VkSurfaceKHR m_surface
The Vulkan surface for this pipeline.
uint04 m_last_image_idx
The index of the last acquired swap chain image.
void cleanResources() override
Cleans up stale or unused GPU resources.
VulkanSession * m_session
The owning Vulkan session.
DynamicPointer< VulkanImageView > m_multisample_view_color
View for the multisample color image.
Buffer< PipelineSemaphores > m_semaphores
Semaphores for each frame in flight.
virtual void drawFrame(GraphicsUpdateArguments &args) override
Renders a single frame.
bool m_needs_pipeline_recreation
Whether the pipeline needs to be recreated.
bool m_suboptimal_khr
Whether the KHR swap chain is suboptimal.
bool m_needs_cleanup
Whether a cleanup pass is needed.
bool m_is_init
Whether the pipeline has been initialized.
DynamicPointer< VulkanImageData > m_frame_grab_image
Image used for frame readback.
virtual bool hasCommand() const override
Checks whether there are pending commands to execute.
Creates and manages the resources necessary for converting a DesignObjectLookup into 3D rendered data...
Contains core information about a Viewport.
The primary namespace for the NDEVR SDK.
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.
A semaphore paired with an active flag for pipeline synchronization.
bool is_active
Whether this semaphore is currently in use.
VkSemaphore semaphore
The Vulkan semaphore handle.
Paired acquire and finish semaphores for a single frame in the render pipeline.
PipelineSemaphore finished
Signaled when rendering to this frame completes.
PipelineSemaphore acquire
Signaled when the swap chain image is acquired.
Details about swap chain support on a physical device.
PrimitiveBuffer< VkSurfaceFormatKHR > formats
Supported surface formats.
VkSurfaceCapabilitiesKHR capabilities
Surface capabilities.
PrimitiveBuffer< VkPresentModeKHR > presentModes
Supported presentation modes.