The open source OpenXR runtime
0
fork

Configure Feed

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

c/main: Fix NVIDIA direct mode detection code

Fix bug introduced in 14ffa34658c94bc39f52b175657c7a488db31649 (!1894).

+7 -34
+7 -34
src/xrt/compositor/main/comp_window_direct_nvidia.c
··· 93 93 (void)title; 94 94 } 95 95 96 - static VkResult 97 - enumerate_physical_device_display_properties(struct vk_bundle *vk, 98 - VkPhysicalDevice physical_device, 99 - VkDisplayPropertiesKHR **out_props, 100 - uint32_t *out_prop_count) 101 - { 102 - VkDisplayPropertiesKHR *props = NULL; 103 - uint32_t prop_count = 0; 104 - VkResult ret; 105 - 106 - ret = vk->vkGetPhysicalDeviceDisplayPropertiesKHR(NULL, &prop_count, NULL); 107 - vk_check_error("vkGetPhysicalDeviceDisplayPropertiesKHR", ret, ret); 108 - if (prop_count == 0) { 109 - *out_props = props; 110 - *out_prop_count = prop_count; 111 - return VK_SUCCESS; 112 - } 113 - 114 - props = U_TYPED_ARRAY_CALLOC(VkDisplayPropertiesKHR, prop_count); 115 - ret = vk->vkGetPhysicalDeviceDisplayPropertiesKHR(NULL, &prop_count, props); 116 - vk_check_error_with_free("vkGetPhysicalDeviceDisplayPropertiesKHR", ret, ret, props); 117 - 118 - *out_props = props; 119 - *out_prop_count = prop_count; 120 - 121 - return VK_SUCCESS; 122 - } 123 - 124 96 struct comp_target * 125 97 comp_window_direct_nvidia_create(struct comp_compositor *c) 126 98 { ··· 341 313 } 342 314 343 315 // Get a list of attached displays. 344 - ret = enumerate_physical_device_display_properties( // 345 - vk, // 346 - vk->physical_device, // 347 - &display_props, // 348 - &display_count); // 316 + ret = vk_enumerate_physical_device_display_properties( // 317 + vk, // 318 + vk->physical_device, // 319 + &display_count, // 320 + &display_props); // 349 321 if (ret != VK_SUCCESS) { 350 - CVK_ERROR(c, "enumerate_physical_device_display_properties", "Failed to get display properties ", ret); 322 + CVK_ERROR(c, "vk_enumerate_physical_device_display_properties", "Failed to get display properties ", 323 + ret); 351 324 return false; 352 325 } 353 326