Monado OpenXR Runtime
|
Holds all pools and static resources for rendering. More...
#include <render/render_interface.h>
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_bundle * | vk |
Vulkan resources. More... | |
struct render_shaders * | shaders |
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 |
Holds all pools and static resources for rendering.
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().
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().
VkCommandBuffer render_resources::cmd |
Command buffer for recording everything.
Referenced by render_compute::render_compute_begin(), and render_compute::render_compute_end().
VkDescriptorPool render_resources::descriptor_pool |
Descriptor pool for compute work.
Referenced by render_compute::render_compute_fini(), and render_resources_close().
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().
VkDeviceMemory render_resources::device_memories[(3 *XRT_MAX_VIEWS)] |
Backing memory to distortion images.
uint32_t render_resources::distortion_binding |
Image storing the distortion.
Referenced by render_resources_init().
struct vk_cmd_pool render_resources::distortion_pool |
Pool used for distortion image uploads.
Referenced by render_resources_close().
uint32_t render_resources::image_array_size |
Size of combined image sampler array.
Referenced by render_resources_init().
VkImageView render_resources::image_views[(3 *XRT_MAX_VIEWS)] |
The views into the distortion images.
Referenced by render_distortion_images_ensure().
VkImage render_resources::images[(3 *XRT_MAX_VIEWS)] |
Distortion images.
VkSampler render_resources::mock |
Sampler for mock/null images.
Referenced by render_resources_close().
struct { ... } render_resources::mock |
Used as a default image empty image when none is given or to pad out fixed sized descriptor sets.
VkPipeline render_resources::non_timewarp_pipeline |
Doesn't depend on target so is static.
Referenced by render_resources_close().
VkPipeline render_resources::pipeline |
Doesn't depend on target so is static.
Referenced by render_gfx::render_gfx_layer_cylinder(), render_gfx::render_gfx_layer_equirect2(), render_gfx::render_gfx_layer_projection(), render_gfx::render_gfx_layer_quad(), and render_resources_close().
VkPipelineCache render_resources::pipeline_cache |
Shared for all rendering.
Referenced by render_resources_close().
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().
bool render_resources::pre_rotated |
Whether distortion images have been pre-rotated 90 degrees.
Referenced by render_distortion_images_ensure().
VkSampler render_resources::repeat |
Sampler that repeats the texture in all directions.
Referenced by render_resources_close().
struct render_shaders* render_resources::shaders |
All shaders loaded.
Referenced by render_resources_init().
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().
uint32_t render_resources::src_binding |
The binding index for the source texture.
The source projection view binding point.
Referenced by render_resources_init().
uint32_t render_resources::target_binding |
Writing the image out too.
Referenced by render_resources_init().
VkPipeline render_resources::timewarp_pipeline |
Doesn't depend on target so is static.
Referenced by render_resources_close().
struct render_buffer render_resources::ubo |
Target info.
Referenced by render_resources_close().
VkDescriptorPool render_resources::ubo_and_src_descriptor_pool |
Pool for shaders that uses one ubo and sampler.
Referenced by render_resources_close().
uint32_t render_resources::ubo_binding |
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().
struct xrt_normalized_rect render_resources::uv_to_tanangle[XRT_MAX_VIEWS] |
Transform to go from UV to tangle angles.
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().
struct vk_bundle* render_resources::vk |
Vulkan resources.
Referenced by render_compute::render_compute_init(), render_distortion_images_close(), render_gfx_render_pass::render_gfx_render_pass_close(), render_gfx_render_pass::render_gfx_render_pass_init(), render_gfx_target_resources::render_gfx_target_resources_init(), render_resources_close(), render_resources_get_duration(), render_resources_get_timestamps(), render_resources_init(), render_scratch_images_close(), vk_from_crc(), and vk_from_rtr().