Monado OpenXR Runtime
render_resources.c File Reference

Shared resources for rendering. More...

#include "xrt/xrt_device.h"
#include "math/m_api.h"
#include "math/m_matrix_2x2.h"
#include "math/m_vec2.h"
#include "vk/vk_mini_helpers.h"
#include "render/render_interface.h"
#include <stdio.h>
Include dependency graph for render_resources.c:

Data Structures

struct  compute_layer_params
 
struct  compute_distortion_params
 

Macros

#define ENTRY(ID, FIELD)
 
#define ENTRY(ID, FIELD)
 

Functions

static XRT_CHECK_RESULT VkResult create_gfx_ubo_and_src_descriptor_set_layout (struct vk_bundle *vk, uint32_t ubo_binding, uint32_t src_binding, VkDescriptorSetLayout *out_descriptor_set_layout)
 
static XRT_CHECK_RESULT bool init_mesh_vertex_buffers (struct vk_bundle *vk, struct render_buffer *vbo, struct render_buffer *ibo, uint32_t vertex_count, uint32_t stride, void *vertices, uint32_t index_counts, void *indices)
 
static XRT_CHECK_RESULT bool init_mesh_ubo_buffers (struct vk_bundle *vk, struct render_buffer ubo[XRT_MAX_VIEWS], uint32_t view_count)
 
static XRT_CHECK_RESULT VkResult create_compute_layer_descriptor_set_layout (struct vk_bundle *vk, uint32_t src_binding, uint32_t target_binding, uint32_t ubo_binding, uint32_t source_images_count, VkDescriptorSetLayout *out_descriptor_set_layout)
 
static XRT_CHECK_RESULT VkResult create_compute_distortion_descriptor_set_layout (struct vk_bundle *vk, uint32_t src_binding, uint32_t distortion_binding, uint32_t target_binding, uint32_t ubo_binding, VkDescriptorSetLayout *out_descriptor_set_layout)
 
static XRT_CHECK_RESULT VkResult create_compute_layer_pipeline (struct vk_bundle *vk, VkPipelineCache pipeline_cache, VkShaderModule shader, VkPipelineLayout pipeline_layout, const struct compute_layer_params *params, VkPipeline *out_compute_pipeline)
 
static XRT_CHECK_RESULT VkResult create_compute_distortion_pipeline (struct vk_bundle *vk, VkPipelineCache pipeline_cache, VkShaderModule shader, VkPipelineLayout pipeline_layout, const struct compute_distortion_params *params, VkPipeline *out_compute_pipeline)
 
static XRT_CHECK_RESULT VkResult prepare_mock_image_locked (struct vk_bundle *vk, VkCommandBuffer cmd, VkImage dst)
 
static XRT_CHECK_RESULT bool create_scratch_image_and_view (struct vk_bundle *vk, VkExtent2D extent, struct render_scratch_color_image *rsci)
 
static void teardown_scratch_color_image (struct vk_bundle *vk, struct render_scratch_color_image *rsci)
 
bool render_resources_init (struct render_resources *r, struct render_shaders *shaders, struct vk_bundle *vk, struct xrt_device *xdev)
 
void render_resources_close (struct render_resources *r)
 
bool render_resources_get_timestamps (struct render_resources *r, uint64_t *out_gpu_start_ns, uint64_t *out_gpu_end_ns)
 
bool render_resources_get_duration (struct render_resources *r, uint64_t *out_gpu_duration_ns)
 
bool render_scratch_images_ensure (struct render_resources *r, struct render_scratch_images *rsi, VkExtent2D extent)
 Ensure that the scratch images are created and have the given extent. More...
 
void render_scratch_images_close (struct render_resources *r, struct render_scratch_images *rsi)
 Close all resources on the given render_scatch_images. More...
 

Detailed Description

Macro Definition Documentation

◆ ENTRY [1/2]

#define ENTRY (   ID,
  FIELD 
)
Value:
{ \
.constantID = ID, \
.offset = offsetof(struct compute_layer_params, FIELD), \
sizeof(params->FIELD), \
}
Definition: render_resources.c:291

◆ ENTRY [2/2]

#define ENTRY (   ID,
  FIELD 
)
Value:
{ \
.constantID = ID, \
.offset = offsetof(struct compute_distortion_params, FIELD), \
sizeof(params->FIELD), \
}
Definition: render_resources.c:299