c/renderer: Expose idle image control.

This commit is contained in:
Lubosz Sarnecki 2020-04-16 17:56:59 +02:00 committed by Jakob Bornecrantz
parent 8082e8dbca
commit 5ba751a239
2 changed files with 38 additions and 4 deletions

View file

@ -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,

View file

@ -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
}