The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

drivers: switch blend mode to array

+35 -7
+4 -1
src/xrt/drivers/hdk/hdk_device.cpp
··· 321 321 (enum u_device_alloc_flags)(U_DEVICE_ALLOC_HMD | U_DEVICE_ALLOC_TRACKING_NONE); 322 322 struct hdk_device *hd = U_DEVICE_ALLOCATE(struct hdk_device, flags, 1, 0); 323 323 324 - hd->base.hmd->blend_mode = XRT_BLEND_MODE_OPAQUE; 324 + size_t idx = 0; 325 + hd->base.hmd->blend_modes[idx++] = XRT_BLEND_MODE_OPAQUE; 326 + hd->base.hmd->num_blend_modes = idx; 327 + 325 328 hd->base.update_inputs = hdk_device_update_inputs; 326 329 hd->base.get_tracked_pose = hdk_device_get_tracked_pose; 327 330 hd->base.get_view_pose = hdk_device_get_view_pose;
+5 -1
src/xrt/drivers/illixr/illixr_device.cpp
··· 177 177 dh->base.destroy = illixr_hmd_destroy; 178 178 dh->base.name = XRT_DEVICE_GENERIC_HMD; 179 179 dh->base.device_type = XRT_DEVICE_TYPE_HMD; 180 - dh->base.hmd->blend_mode = XRT_BLEND_MODE_OPAQUE; 180 + 181 + size_t idx = 0; 182 + dh->base.hmd->blend_modes[idx++] = XRT_BLEND_MODE_OPAQUE; 183 + dh->base.hmd->num_blend_modes = idx; 184 + 181 185 dh->pose.orientation.w = 1.0f; // All other values set to zero. 182 186 dh->print_spew = debug_get_bool_option_illixr_spew(); 183 187 dh->print_debug = debug_get_bool_option_illixr_debug();
+14
src/xrt/drivers/north_star/ns_hmd.c
··· 553 553 ns->base.orientation_tracking_supported = true; 554 554 ns->base.device_type = XRT_DEVICE_TYPE_HMD; 555 555 556 + size_t idx = 0; 557 + // Preferred; most North Stars are see-through. 558 + ns->base.hmd->blend_modes[idx++] = XRT_BLEND_MODE_ADDITIVE; 559 + 560 + // XRT_BLEND_MODE_OPAQUE is not preferred and kind of a lie, but we use North Star for VR sometimes despite its 561 + // see-through display. And there's nothing stopping you from covering up the outside of the reflector, turning 562 + // it into an opaque headset. As most VR apps I've encountered require BLEND_MODE_OPAQUE to be an option, we 563 + // need to support it. 564 + ns->base.hmd->blend_modes[idx++] = XRT_BLEND_MODE_OPAQUE; 565 + 566 + // Not supporting ALPHA_BLEND for now, because I know nothing about it and want to avoid unintended 567 + // consequences. As soon as you have a specific reason to support it, go ahead and support it. 568 + ns->base.hmd->num_blend_modes = idx; 569 + 556 570 return &ns->base; 557 571 558 572 cleanup:
+5 -3
src/xrt/drivers/ohmd/oh_device.c
··· 839 839 ohd->base.compute_distortion = compute_distortion_openhmd; 840 840 841 841 // Which blend modes does the device support. 842 - ohd->base.hmd->blend_mode = XRT_BLEND_MODE_OPAQUE; 842 + 843 + size_t bm_idx = 0; 843 844 if (info.quirks.video_see_through) { 844 - ohd->base.hmd->blend_mode = 845 - (enum xrt_blend_mode)(ohd->base.hmd->blend_mode | XRT_BLEND_MODE_ALPHA_BLEND); 845 + ohd->base.hmd->blend_modes[bm_idx++] = XRT_BLEND_MODE_ALPHA_BLEND; 846 846 } 847 + ohd->base.hmd->blend_modes[bm_idx++] = XRT_BLEND_MODE_OPAQUE; 848 + ohd->base.hmd->num_blend_modes = bm_idx; 847 849 848 850 if (info.quirks.video_distortion_vive) { 849 851 // clang-format off
+3 -1
src/xrt/drivers/survive/survive_driver.c
··· 830 830 831 831 SURVIVE_INFO(survive, "survive HMD present"); 832 832 833 - survive->base.hmd->blend_mode = XRT_BLEND_MODE_OPAQUE; 833 + size_t idx = 0; 834 + survive->base.hmd->blend_modes[idx++] = XRT_BLEND_MODE_OPAQUE; 835 + survive->base.hmd->num_blend_modes = idx; 834 836 835 837 survive->hmd.config = *config; 836 838
+4 -1
src/xrt/drivers/vive/vive_device.c
··· 746 746 (enum u_device_alloc_flags)(U_DEVICE_ALLOC_HMD | U_DEVICE_ALLOC_TRACKING_NONE); 747 747 struct vive_device *d = U_DEVICE_ALLOCATE(struct vive_device, flags, 1, 0); 748 748 749 - d->base.hmd->blend_mode = XRT_BLEND_MODE_OPAQUE; 749 + size_t idx = 0; 750 + d->base.hmd->blend_modes[idx++] = XRT_BLEND_MODE_OPAQUE; 751 + d->base.hmd->num_blend_modes = idx; 752 + 750 753 d->base.update_inputs = vive_device_update_inputs; 751 754 d->base.get_tracked_pose = vive_device_get_tracked_pose; 752 755 d->base.get_view_pose = vive_device_get_view_pose;