mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-04 06:06:17 +00:00
xrt: Move layer enum to xrt namespace.
This commit is contained in:
parent
435f6c5c89
commit
b1d39e7f07
|
@ -328,7 +328,7 @@ compositor_layer_stereo_projection(struct xrt_compositor *xc,
|
|||
|
||||
layer->flags = layer_flags;
|
||||
layer->flip_y = flip_y;
|
||||
layer->type = COMP_LAYER_STEREO_PROJECTION;
|
||||
layer->type = XRT_LAYER_STEREO_PROJECTION;
|
||||
|
||||
c->slots[slot_id].num_layers++;
|
||||
return XRT_SUCCESS;
|
||||
|
@ -366,7 +366,7 @@ compositor_layer_quad(struct xrt_compositor *xc,
|
|||
|
||||
layer->flags = layer_flags;
|
||||
layer->flip_y = flip_y;
|
||||
layer->type = COMP_LAYER_QUAD;
|
||||
layer->type = XRT_LAYER_QUAD;
|
||||
|
||||
c->slots[slot_id].num_layers++;
|
||||
return XRT_SUCCESS;
|
||||
|
@ -389,7 +389,7 @@ compositor_layer_commit(struct xrt_compositor *xc)
|
|||
for (uint32_t i = 0; i < num_layers; i++) {
|
||||
struct comp_layer *layer = &c->slots[slot_id].layers[i];
|
||||
switch (layer->type) {
|
||||
case COMP_LAYER_QUAD: {
|
||||
case XRT_LAYER_QUAD: {
|
||||
struct comp_layer_quad *quad = &layer->quad;
|
||||
struct comp_swapchain_image *image;
|
||||
image = &quad->sc->images[quad->image_index];
|
||||
|
@ -397,7 +397,7 @@ compositor_layer_commit(struct xrt_compositor *xc)
|
|||
&quad->size, layer->flip_y,
|
||||
i, quad->array_index);
|
||||
} break;
|
||||
case COMP_LAYER_STEREO_PROJECTION: {
|
||||
case XRT_LAYER_STEREO_PROJECTION: {
|
||||
struct comp_layer_stereo *stereo = &layer->stereo;
|
||||
struct comp_swapchain_image *right;
|
||||
struct comp_swapchain_image *left;
|
||||
|
|
|
@ -77,16 +77,6 @@ struct comp_swapchain
|
|||
*/
|
||||
struct u_index_fifo fifo;
|
||||
};
|
||||
/*!
|
||||
* Tag for distinguishing the union contents of @ref comp_layer.
|
||||
*/
|
||||
enum comp_layer_type
|
||||
{
|
||||
//! comp_layer::stereo is initialized
|
||||
COMP_LAYER_STEREO_PROJECTION,
|
||||
//! comp_layer::quad is initialized
|
||||
COMP_LAYER_QUAD,
|
||||
};
|
||||
|
||||
/*!
|
||||
* A quad layer.
|
||||
|
@ -131,7 +121,7 @@ struct comp_layer
|
|||
{
|
||||
int64_t timestamp;
|
||||
enum xrt_layer_composition_flags flags;
|
||||
enum comp_layer_type type;
|
||||
enum xrt_layer_type type;
|
||||
bool flip_y;
|
||||
union {
|
||||
struct comp_layer_quad quad;
|
||||
|
|
|
@ -154,7 +154,7 @@ comp_layer_update_stereo_descriptors(struct comp_render_layer *self,
|
|||
static bool
|
||||
_init(struct comp_render_layer *self,
|
||||
struct vk_bundle *vk,
|
||||
enum comp_layer_type type,
|
||||
enum xrt_layer_type type,
|
||||
VkDescriptorSetLayout *layout)
|
||||
{
|
||||
self->vk = vk;
|
||||
|
@ -211,10 +211,10 @@ comp_layer_draw(struct comp_render_layer *self,
|
|||
pipeline);
|
||||
|
||||
switch (self->type) {
|
||||
case COMP_LAYER_STEREO_PROJECTION:
|
||||
case XRT_LAYER_STEREO_PROJECTION:
|
||||
_update_mvp_matrix(self, eye, &proj_scale);
|
||||
break;
|
||||
case COMP_LAYER_QUAD: _update_mvp_matrix(self, eye, vp); break;
|
||||
case XRT_LAYER_QUAD: _update_mvp_matrix(self, eye, vp); break;
|
||||
}
|
||||
|
||||
self->vk->vkCmdBindDescriptorSets(
|
||||
|
@ -230,7 +230,7 @@ comp_layer_draw(struct comp_render_layer *self,
|
|||
|
||||
struct comp_render_layer *
|
||||
comp_layer_create(struct vk_bundle *vk,
|
||||
enum comp_layer_type type,
|
||||
enum xrt_layer_type type,
|
||||
VkDescriptorSetLayout *layout)
|
||||
{
|
||||
struct comp_render_layer *q = U_TYPED_CALLOC(struct comp_render_layer);
|
||||
|
|
|
@ -24,7 +24,7 @@ struct comp_render_layer
|
|||
|
||||
bool visible;
|
||||
|
||||
enum comp_layer_type type;
|
||||
enum xrt_layer_type type;
|
||||
|
||||
struct layer_transformation transformation[2];
|
||||
struct vk_buffer transformation_ubos[2];
|
||||
|
@ -37,7 +37,7 @@ struct comp_render_layer
|
|||
|
||||
struct comp_render_layer *
|
||||
comp_layer_create(struct vk_bundle *vk,
|
||||
enum comp_layer_type type,
|
||||
enum xrt_layer_type type,
|
||||
VkDescriptorSetLayout *layout);
|
||||
|
||||
void
|
||||
|
|
|
@ -451,7 +451,7 @@ comp_layer_renderer_allocate_layers(struct comp_layer_renderer *self,
|
|||
|
||||
for (uint32_t i = 0; i < self->num_layers; i++) {
|
||||
self->layers[i] = comp_layer_create(
|
||||
vk, COMP_LAYER_QUAD, &self->descriptor_set_layout);
|
||||
vk, XRT_LAYER_QUAD, &self->descriptor_set_layout);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -489,7 +489,7 @@ comp_renderer_set_quad_layer(struct comp_renderer *r,
|
|||
|
||||
comp_layer_set_model_matrix(r->lr->layers[layer], &model_matrix);
|
||||
|
||||
r->lr->layers[layer]->type = COMP_LAYER_QUAD;
|
||||
r->lr->layers[layer]->type = XRT_LAYER_QUAD;
|
||||
comp_layer_set_flip_y(r->lr->layers[layer], flip_y);
|
||||
|
||||
r->c->vk.vkDeviceWaitIdle(r->c->vk.device);
|
||||
|
@ -511,7 +511,7 @@ comp_renderer_set_projection_layer(struct comp_renderer *r,
|
|||
|
||||
comp_layer_set_flip_y(r->lr->layers[layer], flip_y);
|
||||
|
||||
r->lr->layers[layer]->type = COMP_LAYER_STEREO_PROJECTION;
|
||||
r->lr->layers[layer]->type = XRT_LAYER_STEREO_PROJECTION;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -69,6 +69,17 @@ enum xrt_view_type
|
|||
XRT_VIEW_TYPE_STEREO = 2,
|
||||
};
|
||||
|
||||
/*!
|
||||
* Layer type.
|
||||
*
|
||||
* @ingroup xrt_iface
|
||||
*/
|
||||
enum xrt_layer_type
|
||||
{
|
||||
XRT_LAYER_STEREO_PROJECTION,
|
||||
XRT_LAYER_QUAD,
|
||||
};
|
||||
|
||||
/*!
|
||||
* @interface xrt_swapchain
|
||||
* Common swapchain interface/base.
|
||||
|
|
|
@ -387,7 +387,7 @@ ipc_compositor_layer_stereo_projection(
|
|||
|
||||
layer->flip_y = flip_y;
|
||||
|
||||
layer->type = IPC_LAYER_STEREO_PROJECTION;
|
||||
layer->type = XRT_LAYER_STEREO_PROJECTION;
|
||||
|
||||
// Increment the number of layers.
|
||||
icc->layers.num_layers++;
|
||||
|
@ -430,7 +430,7 @@ ipc_compositor_layer_quad(struct xrt_compositor *xc,
|
|||
quad->size = *size;
|
||||
|
||||
layer->flip_y = flip_y;
|
||||
layer->type = IPC_LAYER_QUAD;
|
||||
layer->type = XRT_LAYER_QUAD;
|
||||
|
||||
// Increment the number of layers.
|
||||
icc->layers.num_layers++;
|
||||
|
|
|
@ -108,15 +108,9 @@ struct ipc_layer_quad
|
|||
struct xrt_vec2 size;
|
||||
};
|
||||
|
||||
enum ipc_layer_type
|
||||
{
|
||||
IPC_LAYER_STEREO_PROJECTION,
|
||||
IPC_LAYER_QUAD,
|
||||
};
|
||||
|
||||
struct ipc_layer_entry
|
||||
{
|
||||
enum ipc_layer_type type;
|
||||
enum xrt_layer_type type;
|
||||
bool flip_y;
|
||||
|
||||
union {
|
||||
|
|
|
@ -107,7 +107,7 @@ struct ipc_stereo_projection_render_state
|
|||
|
||||
struct ipc_layer_render_state
|
||||
{
|
||||
enum ipc_layer_type type;
|
||||
enum xrt_layer_type type;
|
||||
bool flip_y;
|
||||
|
||||
union {
|
||||
|
|
|
@ -112,7 +112,7 @@ ipc_handle_compositor_layer_sync(volatile struct ipc_client_state *cs,
|
|||
rl->flip_y = sl->flip_y;
|
||||
|
||||
switch (slot->layers[i].type) {
|
||||
case IPC_LAYER_STEREO_PROJECTION:
|
||||
case XRT_LAYER_STEREO_PROJECTION:
|
||||
rl->stereo.l.swapchain_index =
|
||||
sl->stereo.l.swapchain_id;
|
||||
rl->stereo.l.image_index = sl->stereo.l.image_index;
|
||||
|
@ -123,7 +123,7 @@ ipc_handle_compositor_layer_sync(volatile struct ipc_client_state *cs,
|
|||
rl->stereo.r.array_index = sl->stereo.r.array_index;
|
||||
|
||||
break;
|
||||
case IPC_LAYER_QUAD:
|
||||
case XRT_LAYER_QUAD:
|
||||
rl->quad.swapchain_index = sl->quad.swapchain_id;
|
||||
rl->quad.image_index = sl->quad.image_index;
|
||||
rl->quad.pose = sl->quad.pose;
|
||||
|
|
|
@ -590,13 +590,13 @@ _update_layers(struct comp_compositor *c,
|
|||
volatile struct ipc_layer_render_state *layer =
|
||||
&render_state->layers[i];
|
||||
switch (layer->type) {
|
||||
case IPC_LAYER_STEREO_PROJECTION: {
|
||||
case XRT_LAYER_STEREO_PROJECTION: {
|
||||
if (!_update_projection_layer(c, active_client, layer,
|
||||
i))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
case IPC_LAYER_QUAD: {
|
||||
case XRT_LAYER_QUAD: {
|
||||
if (!_update_quad_layer(c, active_client, layer, i))
|
||||
return false;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue