mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-03-03 05:06:31 +00:00
c/comp+ipc: Use array indices again.
This fixes a regression introduced by the IPC and layer rendering patchsets and passes the array_index to the correct places, so the correct VkImageView is used instead of the one with index 0.
This commit is contained in:
parent
f68252bfbe
commit
7186bddf60
src/xrt
|
@ -390,7 +390,7 @@ compositor_layer_commit(struct xrt_compositor *xc)
|
|||
image = &quad->sc->images[quad->image_index];
|
||||
comp_renderer_set_quad_layer(c->r, image, &quad->pose,
|
||||
&quad->size, layer->flip_y,
|
||||
i);
|
||||
i, quad->array_index);
|
||||
} break;
|
||||
case COMP_LAYER_STEREO_PROJECTION: {
|
||||
struct comp_layer_stereo *stereo = &layer->stereo;
|
||||
|
@ -399,8 +399,9 @@ compositor_layer_commit(struct xrt_compositor *xc)
|
|||
left = &stereo->l.sc->images[stereo->l.image_index];
|
||||
right = &stereo->l.sc->images[stereo->r.image_index];
|
||||
|
||||
comp_renderer_set_projection_layer(c->r, left, right,
|
||||
layer->flip_y, i);
|
||||
comp_renderer_set_projection_layer(
|
||||
c->r, left, right, layer->flip_y, i,
|
||||
stereo->l.array_index, stereo->r.array_index);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -478,10 +478,11 @@ comp_renderer_set_quad_layer(struct comp_renderer *r,
|
|||
struct xrt_pose *pose,
|
||||
struct xrt_vec2 *size,
|
||||
bool flip_y,
|
||||
uint32_t layer)
|
||||
uint32_t layer,
|
||||
uint32_t array_index)
|
||||
{
|
||||
comp_layer_update_descriptors(r->lr->layers[layer], image->sampler,
|
||||
image->views[0]);
|
||||
image->views[array_index]);
|
||||
|
||||
struct xrt_matrix_4x4 model_matrix;
|
||||
math_matrix_4x4_quad_model(pose, size, &model_matrix);
|
||||
|
@ -499,11 +500,14 @@ comp_renderer_set_projection_layer(struct comp_renderer *r,
|
|||
struct comp_swapchain_image *left_image,
|
||||
struct comp_swapchain_image *right_image,
|
||||
bool flip_y,
|
||||
uint32_t layer)
|
||||
uint32_t layer,
|
||||
uint32_t left_array_index,
|
||||
uint32_t right_array_index)
|
||||
{
|
||||
comp_layer_update_stereo_descriptors(
|
||||
r->lr->layers[layer], left_image->sampler, right_image->sampler,
|
||||
left_image->views[0], right_image->views[0]);
|
||||
left_image->views[left_array_index],
|
||||
right_image->views[right_array_index]);
|
||||
|
||||
comp_layer_set_flip_y(r->lr->layers[layer], flip_y);
|
||||
|
||||
|
|
|
@ -59,7 +59,9 @@ comp_renderer_set_projection_layer(struct comp_renderer *r,
|
|||
struct comp_swapchain_image *left_image,
|
||||
struct comp_swapchain_image *right_image,
|
||||
bool flip_y,
|
||||
uint32_t layer);
|
||||
uint32_t layer,
|
||||
uint32_t left_array_index,
|
||||
uint32_t right_array_index);
|
||||
|
||||
void
|
||||
comp_renderer_set_quad_layer(struct comp_renderer *r,
|
||||
|
@ -67,7 +69,8 @@ comp_renderer_set_quad_layer(struct comp_renderer *r,
|
|||
struct xrt_pose *pose,
|
||||
struct xrt_vec2 *size,
|
||||
bool flip_y,
|
||||
uint32_t layer);
|
||||
uint32_t layer,
|
||||
uint32_t array_index);
|
||||
|
||||
|
||||
void
|
||||
|
|
|
@ -87,6 +87,7 @@ struct ipc_quad_render_state
|
|||
{
|
||||
uint32_t swapchain_index;
|
||||
uint32_t image_index;
|
||||
uint32_t array_index;
|
||||
|
||||
struct xrt_pose pose;
|
||||
struct xrt_vec2 size;
|
||||
|
@ -98,6 +99,7 @@ struct ipc_stereo_projection_render_state
|
|||
{
|
||||
uint32_t swapchain_index;
|
||||
uint32_t image_index;
|
||||
uint32_t array_index;
|
||||
} l, r;
|
||||
};
|
||||
|
||||
|
|
|
@ -119,12 +119,16 @@ ipc_handle_compositor_layer_sync(volatile struct ipc_client_state *cs,
|
|||
rl->stereo.r.swapchain_index =
|
||||
sl->stereo.r.swapchain_id;
|
||||
rl->stereo.r.image_index = sl->stereo.r.image_index;
|
||||
rl->stereo.l.array_index = sl->stereo.l.array_index;
|
||||
rl->stereo.r.array_index = sl->stereo.r.array_index;
|
||||
|
||||
break;
|
||||
case IPC_LAYER_QUAD:
|
||||
rl->quad.swapchain_index = sl->quad.swapchain_id;
|
||||
rl->quad.image_index = sl->quad.image_index;
|
||||
rl->quad.pose = sl->quad.pose;
|
||||
rl->quad.size = sl->quad.size;
|
||||
rl->quad.array_index = sl->quad.array_index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -538,7 +538,9 @@ _update_projection_layer(struct comp_compositor *c,
|
|||
l = &cl->images[layer->stereo.l.image_index];
|
||||
r = &cr->images[layer->stereo.r.image_index];
|
||||
|
||||
comp_renderer_set_projection_layer(c->r, l, r, layer->flip_y, i);
|
||||
comp_renderer_set_projection_layer(c->r, l, r, layer->flip_y, i,
|
||||
layer->stereo.l.array_index,
|
||||
layer->stereo.r.array_index);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -564,7 +566,7 @@ _update_quad_layer(struct comp_compositor *c,
|
|||
struct xrt_vec2 size = layer->quad.size;
|
||||
|
||||
comp_renderer_set_quad_layer(c->r, image, &pose, &size, layer->flip_y,
|
||||
i);
|
||||
i, layer->quad.array_index);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue