From bcc50dbd4f20e5f8692a130572d65c4f52d8349a Mon Sep 17 00:00:00 2001 From: Christoph Haag Date: Fri, 25 Jun 2021 01:10:25 +0200 Subject: [PATCH] st/oxr: Add checks for Vulkan graphics bindings --- src/xrt/state_trackers/oxr/oxr_session.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xrt/state_trackers/oxr/oxr_session.c b/src/xrt/state_trackers/oxr/oxr_session.c index 7db9311da..f2994b5fc 100644 --- a/src/xrt/state_trackers/oxr/oxr_session.c +++ b/src/xrt/state_trackers/oxr/oxr_session.c @@ -2028,6 +2028,12 @@ oxr_session_create_impl(struct oxr_logger *log, XrGraphicsBindingVulkanKHR const *vulkan = OXR_GET_INPUT_FROM_CHAIN(createInfo, XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR, XrGraphicsBindingVulkanKHR); if (vulkan != NULL) { + OXR_VERIFY_ARG_NOT_ZERO(log, vulkan->instance); + OXR_VERIFY_ARG_NOT_ZERO(log, vulkan->physicalDevice); + if (vulkan->device == VK_NULL_HANDLE) { + return oxr_error(log, XR_ERROR_GRAPHICS_DEVICE_INVALID, "VkDevice must not be VK_NULL_HANDLE"); + } + if (!sys->gotten_requirements) { return oxr_error(log, XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING, "Has not called "