mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Vulkan: Fall back to extension if core functions won't load.
This commit is contained in:
parent
704bcf3699
commit
3e1d131754
2 changed files with 3 additions and 1 deletions
|
@ -616,7 +616,7 @@ void VulkanContext::ChooseDevice(int physical_device) {
|
|||
}
|
||||
|
||||
// Optional features
|
||||
if (extensionsLookup_.KHR_get_physical_device_properties2) {
|
||||
if (extensionsLookup_.KHR_get_physical_device_properties2 && vkGetPhysicalDeviceFeatures2) {
|
||||
VkPhysicalDeviceFeatures2 features2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR};
|
||||
// Add to chain even if not supported, GetPhysicalDeviceFeatures is supposed to ignore unknown structs.
|
||||
VkPhysicalDeviceMultiviewFeatures multiViewFeatures{ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES };
|
||||
|
|
|
@ -267,10 +267,12 @@ bool g_vulkanMayBeAvailable = false;
|
|||
#define LOAD_INSTANCE_FUNC(instance, x) x = (PFN_ ## x)vkGetInstanceProcAddr(instance, #x); if (!x) {INFO_LOG(G3D, "Missing (instance): %s", #x);}
|
||||
#define LOAD_INSTANCE_FUNC_CORE(instance, x, ext_x, min_core) \
|
||||
x = (PFN_ ## x)vkGetInstanceProcAddr(instance, vulkanApiVersion >= min_core ? #x : #ext_x); \
|
||||
if (vulkanApiVersion >= min_core && !x) x = (PFN_ ## x)vkGetInstanceProcAddr(instance, #ext_x); \
|
||||
if (!x) {INFO_LOG(G3D, "Missing (instance): %s (%s)", #x, #ext_x);}
|
||||
#define LOAD_DEVICE_FUNC(instance, x) x = (PFN_ ## x)vkGetDeviceProcAddr(instance, #x); if (!x) {INFO_LOG(G3D, "Missing (device): %s", #x);}
|
||||
#define LOAD_DEVICE_FUNC_CORE(instance, x, ext_x, min_core) \
|
||||
x = (PFN_ ## x)vkGetDeviceProcAddr(instance, vulkanApiVersion >= min_core ? #x : #ext_x); \
|
||||
if (vulkanApiVersion >= min_core && !x) x = (PFN_ ## x)vkGetDeviceProcAddr(instance, #ext_x); \
|
||||
if (!x) {INFO_LOG(G3D, "Missing (device): %s (%s)", #x, #ext_x);}
|
||||
#define LOAD_GLOBAL_FUNC(x) x = (PFN_ ## x)dlsym(vulkanLibrary, #x); if (!x) {INFO_LOG(G3D,"Missing (global): %s", #x);}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue