Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 1 addition & 46 deletions drivers/vulkan/rendering_context_driver_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -905,61 +905,16 @@ Error RenderingContextDriverVulkan::_create_vulkan_instance(const VkInstanceCrea
}

bool RenderingContextDriverVulkan::_vulkan_is_supported() {
if (VulkanHooks::get_singleton() != nullptr) {
VkPhysicalDevice hooked_device = VK_NULL_HANDLE;
return VulkanHooks::get_singleton()->get_physical_device(&hooked_device);
}

#ifdef USE_VOLK
if (volkInitialize() != VK_SUCCESS) {
return false;
}

if (!vkCreateInstance) {
if (!vkGetInstanceProcAddr) {
return false;
}
#endif

VkApplicationInfo app_info{};
app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
app_info.apiVersion = VK_API_VERSION_1_0;

VkInstanceCreateInfo create_info{};
create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
create_info.pApplicationInfo = &app_info;

#if defined(USE_VOLK) && (defined(MACOS_ENABLED) || defined(IOS_ENABLED))
const char *probe_extensions[] = { VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME };
create_info.enabledExtensionCount = 1;
create_info.ppEnabledExtensionNames = probe_extensions;
create_info.flags |= VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
#endif

VkInstance _instance;
if (vkCreateInstance(&create_info, nullptr, &_instance) != VK_SUCCESS) {
return false;
}

#ifdef USE_VOLK
volkLoadInstance(_instance);
#endif

#ifdef USE_VOLK
if (!vkEnumeratePhysicalDevices) {
vkDestroyInstance(_instance, nullptr);
return false;
}
#endif

uint32_t device_count = 0;
VkResult result = vkEnumeratePhysicalDevices(_instance, &device_count, nullptr);

vkDestroyInstance(_instance, nullptr);

if (result != VK_SUCCESS || device_count == 0) {
return false;
}

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion modules/openxr/register_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void initialize_openxr_module(ModuleInitializationLevel p_level) {
#ifdef WINDOWS_ENABLED
"When using Windows Mixed Reality, note that WMR only has DirectX support. Make sure SteamVR is your default OpenXR runtime.\n"
#endif
"Godot will start in normal mode.\n";
"Redot will start in normal mode.\n";

WARN_PRINT(init_error_message);

Expand Down
Loading