mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 18:46:18 +00:00
c/renderer: Expose idle image control.
This commit is contained in:
parent
8082e8dbca
commit
5ba751a239
|
@ -167,6 +167,12 @@ comp_renderer_frame(struct comp_renderer *r,
|
|||
renderer_render(r);
|
||||
}
|
||||
|
||||
void
|
||||
comp_renderer_frame_cached(struct comp_renderer *r)
|
||||
{
|
||||
renderer_render(r);
|
||||
}
|
||||
|
||||
void
|
||||
comp_renderer_destroy(struct comp_renderer *r)
|
||||
{
|
||||
|
@ -606,6 +612,15 @@ _create_fences(struct comp_renderer *r)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_set_dummy_images(struct comp_renderer *r)
|
||||
{
|
||||
for (uint32_t i = 0; i < 2; i++)
|
||||
comp_distortion_update_descriptor_set(
|
||||
r->distortion, r->dummy_images[i].sampler,
|
||||
r->dummy_images[i].views[0], i);
|
||||
}
|
||||
|
||||
static void
|
||||
renderer_init(struct comp_renderer *r)
|
||||
{
|
||||
|
@ -636,14 +651,18 @@ renderer_init(struct comp_renderer *r)
|
|||
r->c->xdev->hmd, r->descriptor_pool,
|
||||
r->settings->flip_y);
|
||||
|
||||
for (uint32_t i = 0; i < 2; i++)
|
||||
comp_distortion_update_descriptor_set(
|
||||
r->distortion, r->dummy_images[i].sampler,
|
||||
r->dummy_images[i].views[0], i);
|
||||
_set_dummy_images(r);
|
||||
|
||||
renderer_build_command_buffers(r);
|
||||
}
|
||||
|
||||
void
|
||||
comp_renderer_set_idle_images(struct comp_renderer *r)
|
||||
{
|
||||
_set_dummy_images(r);
|
||||
renderer_rebuild_command_buffers(r);
|
||||
}
|
||||
|
||||
static void
|
||||
renderer_set_swapchain_image(struct comp_renderer *r,
|
||||
uint32_t eye,
|
||||
|
|
|
@ -58,6 +58,21 @@ comp_renderer_reset(struct comp_renderer *r);
|
|||
void
|
||||
comp_renderer_destroy(struct comp_renderer *r);
|
||||
|
||||
/*!
|
||||
* Set dummy images in renderer.
|
||||
*
|
||||
* @ingroup comp_main
|
||||
*/
|
||||
void
|
||||
comp_renderer_set_idle_images(struct comp_renderer *r);
|
||||
|
||||
/*!
|
||||
* Render frame without setting new images.
|
||||
*
|
||||
* @ingroup comp_main
|
||||
*/
|
||||
void
|
||||
comp_renderer_frame_cached(struct comp_renderer *r);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue