Monado OpenXR Runtime
render_gfx Struct Reference

A rendering is used to create command buffers needed to do one frame of compositor rendering, it holds onto resources used by the command buffer. More...

#include <render/render_interface.h>

Collaboration diagram for render_gfx:

Public Member Functions

bool render_gfx_init (struct render_gfx *rr, struct render_resources *r)
 Init struct and create resources needed for rendering. More...
 
bool render_gfx_begin (struct render_gfx *rr)
 Begins the rendering, takes the vk_bundle's pool lock and leaves it locked. More...
 
bool render_gfx_end (struct render_gfx *rr)
 Frees any unneeded resources and ends the command buffer so it can be used, also unlocks the vk_bundle's pool lock that was taken by begin. More...
 
void render_gfx_fini (struct render_gfx *rr)
 Frees all resources held by the rendering, does not free the struct itself. More...
 
Drawing functions
bool render_gfx_begin_target (struct render_gfx *rr, struct render_gfx_target_resources *rtr, const VkClearColorValue *color)
 This function allocates everything to start a single rendering. More...
 
void render_gfx_end_target (struct render_gfx *rr)
 
void render_gfx_begin_view (struct render_gfx *rr, uint32_t view, const struct render_viewport_data *viewport_data)
 
void render_gfx_end_view (struct render_gfx *rr)
 
XRT_CHECK_RESULT VkResult render_gfx_mesh_alloc_and_write (struct render_gfx *rr, const struct render_gfx_mesh_ubo_data *data, VkSampler src_sampler, VkImageView src_image_view, VkDescriptorSet *out_descriptor_set)
 Allocate needed resources for one mesh shader dispatch, will also update the descriptor set, UBO will be filled out with the given data argument. More...
 
void render_gfx_mesh_draw (struct render_gfx *rr, uint32_t mesh_index, VkDescriptorSet descriptor_set, bool do_timewarp)
 Dispatch one mesh shader instance, using the give mesh_index as source for mesh geometry, timewarp selectable via do_timewarp. More...
 
XRT_CHECK_RESULT VkResult render_gfx_layer_cylinder_alloc_and_write (struct render_gfx *rr, const struct render_gfx_layer_cylinder_data *data, VkSampler src_sampler, VkImageView src_image_view, VkDescriptorSet *out_descriptor_set)
 Allocate and write a UBO and descriptor_set to be used for cylinder layer rendering, the content of data need to be valid at the time of the call. More...
 
XRT_CHECK_RESULT VkResult render_gfx_layer_equirect2_alloc_and_write (struct render_gfx *rr, const struct render_gfx_layer_equirect2_data *data, VkSampler src_sampler, VkImageView src_image_view, VkDescriptorSet *out_descriptor_set)
 Allocate and write a UBO and descriptor_set to be used for equirect2 layer rendering, the content of data need to be valid at the time of the call. More...
 
XRT_CHECK_RESULT VkResult render_gfx_layer_projection_alloc_and_write (struct render_gfx *rr, const struct render_gfx_layer_projection_data *data, VkSampler src_sampler, VkImageView src_image_view, VkDescriptorSet *out_descriptor_set)
 Allocate and write a UBO and descriptor_set to be used for projection layer rendering, the content of data need to be valid at the time of the call. More...
 
XRT_CHECK_RESULT VkResult render_gfx_layer_quad_alloc_and_write (struct render_gfx *rr, const struct render_gfx_layer_quad_data *data, VkSampler src_sampler, VkImageView src_image_view, VkDescriptorSet *out_descriptor_set)
 Allocate and write a UBO and descriptor_set to be used for quad layer rendering, the content of data need to be valid at the time of the call. More...
 
void render_gfx_layer_cylinder (struct render_gfx *rr, bool premultiplied_alpha, VkDescriptorSet descriptor_set)
 Dispatch a cylinder layer shader into the current target and view, allocate descriptor_set and ubo with render_gfx_layer_cylinder_alloc_and_write. More...
 
void render_gfx_layer_equirect2 (struct render_gfx *rr, bool premultiplied_alpha, VkDescriptorSet descriptor_set)
 Dispatch a equirect2 layer shader into the current target and view, allocate descriptor_set and ubo with render_gfx_layer_equirect2_alloc_and_write. More...
 
void render_gfx_layer_projection (struct render_gfx *rr, bool premultiplied_alpha, VkDescriptorSet descriptor_set)
 Dispatch a projection layer shader into the current target and view, allocate descriptor_set and ubo with render_gfx_layer_projection_alloc_and_write. More...
 
void render_gfx_layer_quad (struct render_gfx *rr, bool premultiplied_alpha, VkDescriptorSet descriptor_set)
 Dispatch a quad layer shader into the current target and view, allocate descriptor_set and ubo with render_gfx_layer_quad_alloc_and_write. More...
 

Data Fields

struct render_resourcesr
 Resources that we are based on. More...
 
struct render_sub_alloc_tracker ubo_tracker
 Shared buffer that we sub-allocate UBOs from. More...
 
struct render_gfx_target_resourcesrtr
 The current target we are rendering too, can change during command building. More...
 

Detailed Description

A rendering is used to create command buffers needed to do one frame of compositor rendering, it holds onto resources used by the command buffer.

See also
Comp_render_gfx

Field Documentation

◆ r

◆ rtr

struct render_gfx_target_resources* render_gfx::rtr

◆ ubo_tracker

struct render_sub_alloc_tracker render_gfx::ubo_tracker

Shared buffer that we sub-allocate UBOs from.

Referenced by do_ubo_and_src_alloc_and_write(), and render_gfx_init().


The documentation for this struct was generated from the following file: