From b180b244e3fa0d89a2f520d949a94de3ede17dd9 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Mon, 8 Nov 2021 13:57:51 -0600 Subject: [PATCH] st/oxr: Populate oxr_system's blend modes list from the system compositor, not the device. --- src/xrt/state_trackers/oxr/oxr_system.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/xrt/state_trackers/oxr/oxr_system.c b/src/xrt/state_trackers/oxr/oxr_system.c index ff0bd76e6..7c5e43490 100644 --- a/src/xrt/state_trackers/oxr/oxr_system.c +++ b/src/xrt/state_trackers/oxr/oxr_system.c @@ -154,18 +154,14 @@ oxr_system_fill_in(struct oxr_logger *log, struct oxr_instance *inst, XrSystemId sys->views[1].maxSwapchainSampleCount = info->views[1].max.sample_count; // clang-format on - struct xrt_device *head = GET_XDEV_BY_ROLE(sys, head); + assert(info->num_supported_blend_modes <= ARRAY_SIZE(sys->blend_modes)); + assert(info->num_supported_blend_modes != 0); - assert(head->hmd->num_blend_modes <= XRT_MAX_DEVICE_BLEND_MODES); - assert(head->hmd->num_blend_modes != 0); - - for (size_t i = 0; i < head->hmd->num_blend_modes; i++) { - assert(u_verify_blend_mode_valid(head->hmd->blend_modes[i])); - sys->blend_modes[i] = (XrEnvironmentBlendMode)head->hmd->blend_modes[i]; + for (uint8_t i = 0; i < info->num_supported_blend_modes; i++) { + assert(u_verify_blend_mode_valid(info->supported_blend_modes[i])); + sys->blend_modes[i] = (XrEnvironmentBlendMode)info->supported_blend_modes[i]; } - sys->num_blend_modes = (uint32_t)head->hmd->num_blend_modes; - - assert(sys->num_blend_modes <= ARRAY_SIZE(sys->blend_modes)); + sys->num_blend_modes = (uint32_t)info->num_supported_blend_modes; return XR_SUCCESS; }