The open source OpenXR runtime
0
fork

Configure Feed

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

st/oxr: Check swapchain format support in st

+13
+13
src/xrt/state_trackers/oxr/oxr_api_swapchain.c
··· 76 76 "(createInfo->usageFlags == 0x08%" PRIx64 ") contains invalid flags", 77 77 createInfo->usageFlags); 78 78 } 79 + bool format_supported = false; 80 + struct xrt_compositor *c = sess->compositor; 81 + for (uint32_t i = 0; i < c->info.num_formats; i++) { 82 + if (c->info.formats[i] == createInfo->format) { 83 + format_supported = true; 84 + break; 85 + } 86 + } 87 + 88 + if (!format_supported) { 89 + return oxr_error(&log, XR_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED, 90 + "(createInfo->format == 0x08%" PRIx64 ") is not supported", createInfo->format); 91 + } 79 92 80 93 ret = sess->create_swapchain(&log, sess, createInfo, &sc); 81 94 if (ret != XR_SUCCESS) {