ipc: switch blend mode to array

This commit is contained in:
Moses Turner 2021-04-09 19:36:43 -05:00
parent 1062ef35fc
commit c53eba34d0
3 changed files with 13 additions and 3 deletions

View file

@ -169,8 +169,11 @@ ipc_client_hmd_create(struct ipc_connection *ipc_c, struct xrt_tracking_origin *
return NULL;
}
#endif
for (int i = 0; i < XRT_MAX_DEVICE_BLEND_MODES; i++) {
ich->base.hmd->blend_modes[i] = ipc_c->ism->hmd.blend_modes[i];
}
ich->base.hmd->num_blend_modes = ipc_c->ism->hmd.num_blend_modes;
ich->base.hmd->blend_mode = ipc_c->ism->hmd.blend_mode;
ich->base.hmd->views[0].display.w_pixels = ipc_c->ism->hmd.views[0].display.w_pixels;
ich->base.hmd->views[0].display.h_pixels = ipc_c->ism->hmd.views[0].display.h_pixels;
ich->base.hmd->views[0].fov = ipc_c->ism->hmd.views[0].fov;

View file

@ -20,6 +20,7 @@
#include "util/u_misc.h"
#include "util/u_debug.h"
#include "util/u_trace_marker.h"
#include "util/u_verify.h"
#include "shared/ipc_shmem.h"
#include "server/ipc_server.h"
@ -252,7 +253,12 @@ init_shm(struct ipc_server *s)
ism->hmd.views[1].display.h_pixels = xdev->hmd->views[1].display.h_pixels;
ism->hmd.views[1].fov = xdev->hmd->views[1].fov;
ism->hmd.blend_mode = xdev->hmd->blend_mode;
for (size_t i = 0; i < xdev->hmd->num_blend_modes; i++) {
// Not super necessary, we also do this assert in oxr_system.c
assert(u_verify_blend_mode_valid(xdev->hmd->blend_modes[i]));
ism->hmd.blend_modes[i] = xdev->hmd->blend_modes[i];
}
ism->hmd.num_blend_modes = xdev->hmd->num_blend_modes;
}
// Setup the tracking origin.

View file

@ -225,7 +225,8 @@ struct ipc_shared_memory
*/
struct xrt_fov fov;
} views[2];
enum xrt_blend_mode blend_mode;
enum xrt_blend_mode blend_modes[XRT_MAX_DEVICE_BLEND_MODES];
size_t num_blend_modes;
} hmd;
struct xrt_input inputs[IPC_SHARED_MAX_INPUTS];