Monado OpenXR Runtime
render_resources Struct Reference

Holds all pools and static resources for rendering. More...

#include <render/render_interface.h>

Collaboration diagram for render_resources:

Public Member Functions

bool render_resources_init (struct render_resources *r, struct render_shaders *shaders, struct vk_bundle *vk, struct xrt_device *xdev)
 Allocate pools and static resources. More...
 
void render_resources_close (struct render_resources *r)
 Free all pools and static resources, does not free the struct itself. More...
 
bool render_resources_get_timestamps (struct render_resources *r, uint64_t *out_gpu_start_ns, uint64_t *out_gpu_end_ns)
 Returns the timestamps for when the latest GPU work started and stopped that was submitted using render_gfx or render_compute cmd buf builders. More...
 
bool render_resources_get_duration (struct render_resources *r, uint64_t *out_gpu_duration_ns)
 Returns the duration for the latest GPU work that was submitted using render_gfx or render_compute cmd buf builders. More...
 

Data Fields

uint32_t view_count
 The count of views that we are rendering to. More...
 
struct vk_bundlevk
 Vulkan resources. More...
 
struct render_shadersshaders
 All shaders loaded. More...
 
struct vk_cmd_pool distortion_pool
 Pool used for distortion image uploads. More...
 
VkPipelineCache pipeline_cache
 Shared for all rendering. More...
 
VkCommandPool cmd_pool
 
VkQueryPool query_pool
 
VkCommandBuffer cmd
 Command buffer for recording everything. More...
 
struct {
   VkSampler   mock
 Sampler for mock/null images. More...
 
   VkSampler   repeat
 Sampler that repeats the texture in all directions. More...
 
   VkSampler   clamp_to_edge
 Sampler that clamps the coordinates to the edge in all directions. More...
 
   VkSampler   clamp_to_border_black
 Sampler that clamps color samples to black in all directions. More...
 
samplers
 
struct {
   VkDescriptorPool   ubo_and_src_descriptor_pool
 Pool for shaders that uses one ubo and sampler. More...
 
   struct render_buffer   shared_ubo
 Shared UBO buffer that we sub-allocate out of, this is to have fewer buffers that the kernel needs to validate on command submission time. More...
 
   struct {
      struct {
         VkDescriptorSetLayout   descriptor_set_layout
 For projection and quad layer. More...
 
         VkPipelineLayout   pipeline_layout
 For projection and quad layer. More...
 
      }   shared
 
   }   layer
 
gfx
 
struct {
   uint32_t   src_binding
 The binding index for the source texture. More...
 
   uint32_t   ubo_binding
 The binding index for the UBO. More...
 
   VkDescriptorSetLayout   descriptor_set_layout
 Descriptor set layout for mesh distortion. More...
 
   VkPipelineLayout   pipeline_layout
 Pipeline layout used for mesh. More...
 
   struct render_buffer   vbo
 
   struct render_buffer   ibo
 
   uint32_t   vertex_count
 
   uint32_t   index_counts [XRT_MAX_VIEWS]
 
   uint32_t   stride
 
   uint32_t   index_offsets [XRT_MAX_VIEWS]
 
   uint32_t   index_count_total
 
   struct render_buffer   ubos [XRT_MAX_VIEWS]
 Info ubos, only supports two views currently. More...
 
mesh
 
struct {
   struct {
      VkImage   image
 
      VkImageView   image_view
 
      VkDeviceMemory   memory
 
   }   color
 
mock
 Used as a default image empty image when none is given or to pad out fixed sized descriptor sets. More...
 
struct {
   VkDescriptorPool   descriptor_pool
 Descriptor pool for compute work. More...
 
   uint32_t   src_binding
 The source projection view binding point. More...
 
   uint32_t   distortion_binding
 Image storing the distortion. More...
 
   uint32_t   target_binding
 Writing the image out too. More...
 
   uint32_t   ubo_binding
 Uniform data binding. More...
 
   struct {
      VkDescriptorSetLayout   descriptor_set_layout
 Descriptor set layout for compute. More...
 
      VkPipelineLayout   pipeline_layout
 Pipeline layout used for compute distortion. More...
 
      VkPipeline   non_timewarp_pipeline
 Doesn't depend on target so is static. More...
 
      VkPipeline   timewarp_pipeline
 Doesn't depend on target so is static. More...
 
      uint32_t   image_array_size
 Size of combined image sampler array. More...
 
      struct render_buffer   ubos [(XRT_MAX_VIEWS)]
 Target info. More...
 
   }   layer
 
   struct {
      VkDescriptorSetLayout   descriptor_set_layout
 Descriptor set layout for compute distortion. More...
 
      VkPipelineLayout   pipeline_layout
 Pipeline layout used for compute distortion, shared with clear. More...
 
      VkPipeline   pipeline
 Doesn't depend on target so is static. More...
 
      VkPipeline   timewarp_pipeline
 Doesn't depend on target so is static. More...
 
      struct render_buffer   ubo
 Target info. More...
 
   }   distortion
 
   struct {
      VkPipeline   pipeline
 Doesn't depend on target so is static. More...
 
      struct render_buffer   ubo
 Target info. More...
 
   }   clear
 
compute
 
struct {
   struct xrt_normalized_rect   uv_to_tanangle [XRT_MAX_VIEWS]
 Transform to go from UV to tangle angles. More...
 
   VkDeviceMemory   device_memories [(3 *XRT_MAX_VIEWS)]
 Backing memory to distortion images. More...
 
   VkImage   images [(3 *XRT_MAX_VIEWS)]
 Distortion images. More...
 
   VkImageView   image_views [(3 *XRT_MAX_VIEWS)]
 The views into the distortion images. More...
 
   bool   pre_rotated
 Whether distortion images have been pre-rotated 90 degrees. More...
 
distortion
 

Detailed Description

Holds all pools and static resources for rendering.

Field Documentation

◆ clamp_to_border_black

VkSampler render_resources::clamp_to_border_black

Sampler that clamps color samples to black in all directions.

Referenced by comp_render_cs_layer(), and render_resources_close().

◆ clamp_to_edge

VkSampler render_resources::clamp_to_edge

Sampler that clamps the coordinates to the edge in all directions.

Referenced by comp_render_cs_layer(), and render_resources_close().

◆ cmd

VkCommandBuffer render_resources::cmd

Command buffer for recording everything.

Referenced by render_compute::render_compute_begin(), and render_compute::render_compute_end().

◆ descriptor_pool

VkDescriptorPool render_resources::descriptor_pool

Descriptor pool for compute work.

Referenced by render_compute::render_compute_fini(), and render_resources_close().

◆ descriptor_set_layout

VkDescriptorSetLayout render_resources::descriptor_set_layout

For projection and quad layer.

Descriptor set layout for compute distortion.

Descriptor set layout for compute.

Descriptor set layout for mesh distortion.

Referenced by render_resources_close().

◆ device_memories

VkDeviceMemory render_resources::device_memories[(3 *XRT_MAX_VIEWS)]

Backing memory to distortion images.

◆ distortion_binding

uint32_t render_resources::distortion_binding

Image storing the distortion.

Referenced by render_resources_init().

◆ distortion_pool

struct vk_cmd_pool render_resources::distortion_pool

Pool used for distortion image uploads.

Referenced by render_resources_close().

◆ image_array_size

uint32_t render_resources::image_array_size

Size of combined image sampler array.

Referenced by render_resources_init().

◆ image_views

VkImageView render_resources::image_views[(3 *XRT_MAX_VIEWS)]

The views into the distortion images.

Referenced by render_distortion_images_ensure().

◆ images

VkImage render_resources::images[(3 *XRT_MAX_VIEWS)]

Distortion images.

◆ mock [1/2]

VkSampler render_resources::mock

Sampler for mock/null images.

Referenced by render_resources_close().

◆  [2/2]

struct { ... } render_resources::mock

Used as a default image empty image when none is given or to pad out fixed sized descriptor sets.

◆ non_timewarp_pipeline

VkPipeline render_resources::non_timewarp_pipeline

Doesn't depend on target so is static.

Referenced by render_resources_close().

◆ pipeline

◆ pipeline_cache

VkPipelineCache render_resources::pipeline_cache

Shared for all rendering.

Referenced by render_resources_close().

◆ pipeline_layout

VkPipelineLayout render_resources::pipeline_layout

For projection and quad layer.

Pipeline layout used for compute distortion, shared with clear.

Pipeline layout used for compute distortion.

Pipeline layout used for mesh.

Referenced by render_resources_close().

◆ pre_rotated

bool render_resources::pre_rotated

Whether distortion images have been pre-rotated 90 degrees.

Referenced by render_distortion_images_ensure().

◆ repeat

VkSampler render_resources::repeat

Sampler that repeats the texture in all directions.

Referenced by render_resources_close().

◆ shaders

struct render_shaders* render_resources::shaders

All shaders loaded.

Referenced by render_resources_init().

◆ shared_ubo

struct render_buffer render_resources::shared_ubo

Shared UBO buffer that we sub-allocate out of, this is to have fewer buffers that the kernel needs to validate on command submission time.

https://registry.khronos.org/vulkan/site/guide/latest/memory_allocation.html

Referenced by render_gfx::render_gfx_init(), and render_resources_close().

◆ src_binding

uint32_t render_resources::src_binding

The binding index for the source texture.

The source projection view binding point.

Referenced by render_resources_init().

◆ target_binding

uint32_t render_resources::target_binding

Writing the image out too.

Referenced by render_resources_init().

◆ timewarp_pipeline

VkPipeline render_resources::timewarp_pipeline

Doesn't depend on target so is static.

Referenced by render_resources_close().

◆ ubo

struct render_buffer render_resources::ubo

Target info.

Referenced by render_resources_close().

◆ ubo_and_src_descriptor_pool

VkDescriptorPool render_resources::ubo_and_src_descriptor_pool

Pool for shaders that uses one ubo and sampler.

Referenced by render_resources_close().

◆ ubo_binding

uint32_t render_resources::ubo_binding

The binding index for the UBO.

Uniform data binding.

Referenced by render_resources_init().

◆ ubos

struct render_buffer render_resources::ubos[(XRT_MAX_VIEWS)]

Info ubos, only supports two views currently.

Target info.

Referenced by comp_render_cs_layer(), and render_resources_close().

◆ uv_to_tanangle

struct xrt_normalized_rect render_resources::uv_to_tanangle[XRT_MAX_VIEWS]

Transform to go from UV to tangle angles.

◆ view_count

uint32_t render_resources::view_count

The count of views that we are rendering to.

Referenced by render_resources_close(), render_resources_init(), render_scratch_images_close(), and render_scratch_images_ensure().

◆ vk


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