Monado OpenXR Runtime
Loading...
Searching...
No Matches
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.
 
void render_resources_fini (struct render_resources *r)
 Free all pools and static resources, does not free the struct itself.
 
bool render_distortion_images_ensure (struct render_resources *r, struct vk_bundle *vk, struct xrt_device *xdev, bool pre_rotate)
 Creates or recreates the compute distortion textures if necessary.
 
void render_distortion_images_fini (struct render_resources *r)
 Free distortion images.
 
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.
 
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.
 

Data Fields

uint32_t view_count
 The count of views that we are rendering to.
 
struct vk_bundlevk
 Vulkan resources.
 
struct render_shadersshaders
 All shaders loaded.
 
struct vk_cmd_pool distortion_pool
 Pool used for distortion image uploads.
 
VkPipelineCache pipeline_cache
 Shared for all rendering.
 
VkCommandPool cmd_pool
 
VkQueryPool query_pool
 
VkCommandBuffer cmd
 Command buffer for recording everything.
 
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. 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.
 
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

◆ 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(), comp_render_gfx_layers(), comp_renderer::comp_renderer_draw(), render_resources_fini(), and render_resources_init().

◆ cmd

◆ descriptor_pool

VkDescriptorPool render_resources::descriptor_pool

◆ descriptor_set_layout

VkDescriptorSetLayout render_resources::descriptor_set_layout

◆ device_memories

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

Backing memory to distortion images.

Referenced by render_distortion_images_fini(), and render_resources_init().

◆ 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_fini(), and render_resources_init().

◆ image_array_size

uint32_t render_resources::image_array_size

Size of combined image sampler array.

Referenced by comp_render_cs_layer(), and 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(), render_distortion_images_fini(), and render_resources_init().

◆ images

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

Distortion images.

Referenced by render_distortion_images_fini(), and render_resources_init().

◆ mock [1/2]

VkSampler render_resources::mock

Sampler for mock/null images.

Referenced by comp_render_cs_layer(), render_resources_fini(), and render_resources_init().

◆ [struct] [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_fini(), and render_resources_init().

◆ pipeline

◆ pipeline_cache

VkPipelineCache render_resources::pipeline_cache

◆ 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_gfx::render_gfx_mesh_draw(), render_gfx_render_pass::render_gfx_render_pass_init(), render_resources_fini(), and render_resources_init().

◆ 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_fini(), and render_resources_init().

◆ shaders

struct render_shaders* render_resources::shaders

◆ 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(), render_resources_fini(), and render_resources_init().

◆ src_binding

uint32_t render_resources::src_binding

The binding index for the source texture.

The source projection view binding point.

Referenced by render_gfx::render_gfx_mesh_alloc_and_write(), render_gfx_render_pass::render_gfx_render_pass_init(), and 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_fini(), and render_resources_init().

◆ ubo

struct render_buffer render_resources::ubo

Target info.

Referenced by render_resources_fini(), and render_resources_init().

◆ ubo_and_src_descriptor_pool

◆ ubo_binding

uint32_t render_resources::ubo_binding

The binding index for the UBO.

Uniform data binding.

Referenced by render_gfx::render_gfx_mesh_alloc_and_write(), and render_resources_init().

◆ ubos

struct render_buffer render_resources::ubos[(XRT_MAX_VIEWS)]

Info UBOs.

Target info.

Referenced by comp_render_cs_layer(), render_resources_fini(), and render_resources_init().

◆ 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

◆ vk


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