GS/Vulkan: Remove more unused code

This commit is contained in:
Stenzek 2023-05-06 15:06:15 +10:00 committed by refractionpcsx2
parent 1866745936
commit 0526769808
7 changed files with 18 additions and 293 deletions

View File

@ -665,19 +665,6 @@ if(USE_VULKAN)
GS/Renderers/Vulkan/VKUtil.h
)
target_link_libraries(PCSX2_FLAGS INTERFACE Vulkan-Headers glslang)
if(APPLE)
# Needed for Metal surface creation.
target_compile_options(common PRIVATE -fobjc-arc)
target_link_options(common PRIVATE -fobjc-link-runtime)
elseif(NOT WIN32)
if(X11_API)
target_compile_definitions(common PUBLIC "VULKAN_USE_X11=1")
endif()
if(WAYLAND_API)
target_compile_definitions(common PUBLIC "VULKAN_USE_WAYLAND=1")
endif()
endif()
endif()
set(pcsx2GSMetalShaders

View File

@ -174,24 +174,18 @@ bool VKContext::SelectInstanceExtensions(ExtensionList* extension_list, const Wi
if (wi.type == WindowInfo::Type::Wayland && !SupportsExtension(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, true))
return false;
#endif
#if defined(VK_USE_PLATFORM_ANDROID_KHR)
if (wi.type == WindowInfo::Type::Android && !SupportsExtension(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, true))
return false;
#endif
#if defined(VK_USE_PLATFORM_METAL_EXT)
if (wi.type == WindowInfo::Type::MacOS && !SupportsExtension(VK_EXT_METAL_SURFACE_EXTENSION_NAME, true))
return false;
#endif
#if 0
if (wi.type == WindowInfo::Type::Display && !SupportsExtension(VK_KHR_DISPLAY_EXTENSION_NAME, true))
return false;
#endif
// VK_EXT_debug_utils
if (enable_debug_utils && !SupportsExtension(VK_EXT_DEBUG_UTILS_EXTENSION_NAME, false))
Console.Warning("Vulkan: Debug report requested, but extension is not available.");
// Needed for exclusive fullscreen control.
SupportsExtension(VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME, false);
return true;
}
@ -395,7 +389,6 @@ bool VKContext::SelectDeviceExtensions(ExtensionList* extension_list, bool enabl
#ifdef _WIN32
m_optional_extensions.vk_ext_full_screen_exclusive =
SupportsExtension(VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME, false) &&
SupportsExtension(VK_EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME, false);
#endif

View File

@ -19,14 +19,10 @@
extern "C" {
#endif
// We abuse the preprocessor here to only need to specify function names once.
// Function names are prefixed so to not conflict with system symbols at runtime.
#define VULKAN_MODULE_ENTRY_POINT(name, required) extern PFN_##name pcsx2_##name;
#define VULKAN_INSTANCE_ENTRY_POINT(name, required) extern PFN_##name pcsx2_##name;
#define VULKAN_DEVICE_ENTRY_POINT(name, required) extern PFN_##name pcsx2_##name;
#define VULKAN_DEFINE_NAME_PREFIX pcsx2_
#define VULKAN_MODULE_ENTRY_POINT(name, required) extern PFN_##name name;
#define VULKAN_INSTANCE_ENTRY_POINT(name, required) extern PFN_##name name;
#define VULKAN_DEVICE_ENTRY_POINT(name, required) extern PFN_##name name;
#include "VKEntryPoints.inl"
#undef VULKAN_DEFINE_NAME_PREFIX
#undef VULKAN_DEVICE_ENTRY_POINT
#undef VULKAN_INSTANCE_ENTRY_POINT
#undef VULKAN_MODULE_ENTRY_POINT
@ -34,204 +30,3 @@ extern "C" {
#ifdef __cplusplus
}
#endif
#define vkCreateInstance pcsx2_vkCreateInstance
#define vkGetInstanceProcAddr pcsx2_vkGetInstanceProcAddr
#define vkEnumerateInstanceExtensionProperties pcsx2_vkEnumerateInstanceExtensionProperties
#define vkEnumerateInstanceLayerProperties pcsx2_vkEnumerateInstanceLayerProperties
#define vkEnumerateInstanceVersion pcsx2_vkEnumerateInstanceVersion
#define vkGetDeviceProcAddr pcsx2_vkGetDeviceProcAddr
#define vkDestroyInstance pcsx2_vkDestroyInstance
#define vkEnumeratePhysicalDevices pcsx2_vkEnumeratePhysicalDevices
#define vkGetPhysicalDeviceFeatures pcsx2_vkGetPhysicalDeviceFeatures
#define vkGetPhysicalDeviceFormatProperties pcsx2_vkGetPhysicalDeviceFormatProperties
#define vkGetPhysicalDeviceImageFormatProperties pcsx2_vkGetPhysicalDeviceImageFormatProperties
#define vkGetPhysicalDeviceProperties pcsx2_vkGetPhysicalDeviceProperties
#define vkGetPhysicalDeviceQueueFamilyProperties pcsx2_vkGetPhysicalDeviceQueueFamilyProperties
#define vkGetPhysicalDeviceMemoryProperties pcsx2_vkGetPhysicalDeviceMemoryProperties
#define vkCreateDevice pcsx2_vkCreateDevice
#define vkEnumerateDeviceExtensionProperties pcsx2_vkEnumerateDeviceExtensionProperties
#define vkEnumerateDeviceLayerProperties pcsx2_vkEnumerateDeviceLayerProperties
#define vkGetPhysicalDeviceSparseImageFormatProperties pcsx2_vkGetPhysicalDeviceSparseImageFormatProperties
#define vkDestroySurfaceKHR pcsx2_vkDestroySurfaceKHR
#define vkGetPhysicalDeviceSurfaceSupportKHR pcsx2_vkGetPhysicalDeviceSurfaceSupportKHR
#define vkGetPhysicalDeviceSurfaceCapabilitiesKHR pcsx2_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
#define vkGetPhysicalDeviceSurfaceFormatsKHR pcsx2_vkGetPhysicalDeviceSurfaceFormatsKHR
#define vkGetPhysicalDeviceSurfacePresentModesKHR pcsx2_vkGetPhysicalDeviceSurfacePresentModesKHR
#define vkCreateWin32SurfaceKHR pcsx2_vkCreateWin32SurfaceKHR
#define vkGetPhysicalDeviceWin32PresentationSupportKHR pcsx2_vkGetPhysicalDeviceWin32PresentationSupportKHR
#define vkCreateXlibSurfaceKHR pcsx2_vkCreateXlibSurfaceKHR
#define vkGetPhysicalDeviceXlibPresentationSupportKHR pcsx2_vkGetPhysicalDeviceXlibPresentationSupportKHR
#define vkCreateWaylandSurfaceKHR pcsx2_vkCreateWaylandSurfaceKHR
#define vkCreateAndroidSurfaceKHR pcsx2_vkCreateAndroidSurfaceKHR
#define vkCreateMacOSSurfaceMVK pcsx2_vkCreateMacOSSurfaceMVK
#define vkCreateMetalSurfaceEXT pcsx2_vkCreateMetalSurfaceEXT
// VK_EXT_debug_utils
#define vkCmdBeginDebugUtilsLabelEXT pcsx2_vkCmdBeginDebugUtilsLabelEXT
#define vkCmdEndDebugUtilsLabelEXT pcsx2_vkCmdEndDebugUtilsLabelEXT
#define vkCmdInsertDebugUtilsLabelEXT pcsx2_vkCmdInsertDebugUtilsLabelEXT
#define vkCreateDebugUtilsMessengerEXT pcsx2_vkCreateDebugUtilsMessengerEXT
#define vkDestroyDebugUtilsMessengerEXT pcsx2_vkDestroyDebugUtilsMessengerEXT
#define vkQueueBeginDebugUtilsLabelEXT pcsx2_vkQueueBeginDebugUtilsLabelEXT
#define vkQueueEndDebugUtilsLabelEXT pcsx2_vkQueueEndDebugUtilsLabelEXT
#define vkQueueInsertDebugUtilsLabelEXT pcsx2_vkQueueInsertDebugUtilsLabelEXT
#define vkSetDebugUtilsObjectNameEXT pcsx2_vkSetDebugUtilsObjectNameEXT
#define vkSetDebugUtilsObjectTagEXT pcsx2_vkSetDebugUtilsObjectTagEXT
#define vkSubmitDebugUtilsMessageEXT pcsx2_vkSubmitDebugUtilsMessageEXT
#define vkGetPhysicalDeviceSurfaceCapabilities2KHR pcsx2_vkGetPhysicalDeviceSurfaceCapabilities2KHR
#define vkGetPhysicalDeviceDisplayPropertiesKHR pcsx2_vkGetPhysicalDeviceDisplayPropertiesKHR
#define vkGetPhysicalDeviceDisplayPlanePropertiesKHR pcsx2_vkGetPhysicalDeviceDisplayPlanePropertiesKHR
#define vkGetDisplayPlaneSupportedDisplaysKHR pcsx2_vkGetDisplayPlaneSupportedDisplaysKHR
#define vkGetDisplayModePropertiesKHR pcsx2_vkGetDisplayModePropertiesKHR
#define vkCreateDisplayModeKHR pcsx2_vkCreateDisplayModeKHR
#define vkGetDisplayPlaneCapabilitiesKHR pcsx2_vkGetDisplayPlaneCapabilitiesKHR
#define vkCreateDisplayPlaneSurfaceKHR pcsx2_vkCreateDisplayPlaneSurfaceKHR
// Vulkan 1.1 functions.
#define vkGetPhysicalDeviceFeatures2 pcsx2_vkGetPhysicalDeviceFeatures2
#define vkGetPhysicalDeviceProperties2 pcsx2_vkGetPhysicalDeviceProperties2
#define vkGetPhysicalDeviceMemoryProperties2 pcsx2_vkGetPhysicalDeviceMemoryProperties2
#define vkDestroyDevice pcsx2_vkDestroyDevice
#define vkGetDeviceQueue pcsx2_vkGetDeviceQueue
#define vkQueueSubmit pcsx2_vkQueueSubmit
#define vkQueueWaitIdle pcsx2_vkQueueWaitIdle
#define vkDeviceWaitIdle pcsx2_vkDeviceWaitIdle
#define vkAllocateMemory pcsx2_vkAllocateMemory
#define vkFreeMemory pcsx2_vkFreeMemory
#define vkMapMemory pcsx2_vkMapMemory
#define vkUnmapMemory pcsx2_vkUnmapMemory
#define vkFlushMappedMemoryRanges pcsx2_vkFlushMappedMemoryRanges
#define vkInvalidateMappedMemoryRanges pcsx2_vkInvalidateMappedMemoryRanges
#define vkGetDeviceMemoryCommitment pcsx2_vkGetDeviceMemoryCommitment
#define vkBindBufferMemory pcsx2_vkBindBufferMemory
#define vkBindImageMemory pcsx2_vkBindImageMemory
#define vkGetBufferMemoryRequirements pcsx2_vkGetBufferMemoryRequirements
#define vkGetImageMemoryRequirements pcsx2_vkGetImageMemoryRequirements
#define vkGetImageSparseMemoryRequirements pcsx2_vkGetImageSparseMemoryRequirements
#define vkQueueBindSparse pcsx2_vkQueueBindSparse
#define vkCreateFence pcsx2_vkCreateFence
#define vkDestroyFence pcsx2_vkDestroyFence
#define vkResetFences pcsx2_vkResetFences
#define vkGetFenceStatus pcsx2_vkGetFenceStatus
#define vkWaitForFences pcsx2_vkWaitForFences
#define vkCreateSemaphore pcsx2_vkCreateSemaphore
#define vkDestroySemaphore pcsx2_vkDestroySemaphore
#define vkCreateEvent pcsx2_vkCreateEvent
#define vkDestroyEvent pcsx2_vkDestroyEvent
#define vkGetEventStatus pcsx2_vkGetEventStatus
#define vkSetEvent pcsx2_vkSetEvent
#define vkResetEvent pcsx2_vkResetEvent
#define vkCreateQueryPool pcsx2_vkCreateQueryPool
#define vkDestroyQueryPool pcsx2_vkDestroyQueryPool
#define vkGetQueryPoolResults pcsx2_vkGetQueryPoolResults
#define vkCreateBuffer pcsx2_vkCreateBuffer
#define vkDestroyBuffer pcsx2_vkDestroyBuffer
#define vkCreateBufferView pcsx2_vkCreateBufferView
#define vkDestroyBufferView pcsx2_vkDestroyBufferView
#define vkCreateImage pcsx2_vkCreateImage
#define vkDestroyImage pcsx2_vkDestroyImage
#define vkGetImageSubresourceLayout pcsx2_vkGetImageSubresourceLayout
#define vkCreateImageView pcsx2_vkCreateImageView
#define vkDestroyImageView pcsx2_vkDestroyImageView
#define vkCreateShaderModule pcsx2_vkCreateShaderModule
#define vkDestroyShaderModule pcsx2_vkDestroyShaderModule
#define vkCreatePipelineCache pcsx2_vkCreatePipelineCache
#define vkDestroyPipelineCache pcsx2_vkDestroyPipelineCache
#define vkGetPipelineCacheData pcsx2_vkGetPipelineCacheData
#define vkMergePipelineCaches pcsx2_vkMergePipelineCaches
#define vkCreateGraphicsPipelines pcsx2_vkCreateGraphicsPipelines
#define vkCreateComputePipelines pcsx2_vkCreateComputePipelines
#define vkDestroyPipeline pcsx2_vkDestroyPipeline
#define vkCreatePipelineLayout pcsx2_vkCreatePipelineLayout
#define vkDestroyPipelineLayout pcsx2_vkDestroyPipelineLayout
#define vkCreateSampler pcsx2_vkCreateSampler
#define vkDestroySampler pcsx2_vkDestroySampler
#define vkCreateDescriptorSetLayout pcsx2_vkCreateDescriptorSetLayout
#define vkDestroyDescriptorSetLayout pcsx2_vkDestroyDescriptorSetLayout
#define vkCreateDescriptorPool pcsx2_vkCreateDescriptorPool
#define vkDestroyDescriptorPool pcsx2_vkDestroyDescriptorPool
#define vkResetDescriptorPool pcsx2_vkResetDescriptorPool
#define vkAllocateDescriptorSets pcsx2_vkAllocateDescriptorSets
#define vkFreeDescriptorSets pcsx2_vkFreeDescriptorSets
#define vkUpdateDescriptorSets pcsx2_vkUpdateDescriptorSets
#define vkCreateFramebuffer pcsx2_vkCreateFramebuffer
#define vkDestroyFramebuffer pcsx2_vkDestroyFramebuffer
#define vkCreateRenderPass pcsx2_vkCreateRenderPass
#define vkDestroyRenderPass pcsx2_vkDestroyRenderPass
#define vkGetRenderAreaGranularity pcsx2_vkGetRenderAreaGranularity
#define vkCreateCommandPool pcsx2_vkCreateCommandPool
#define vkDestroyCommandPool pcsx2_vkDestroyCommandPool
#define vkResetCommandPool pcsx2_vkResetCommandPool
#define vkAllocateCommandBuffers pcsx2_vkAllocateCommandBuffers
#define vkFreeCommandBuffers pcsx2_vkFreeCommandBuffers
#define vkBeginCommandBuffer pcsx2_vkBeginCommandBuffer
#define vkEndCommandBuffer pcsx2_vkEndCommandBuffer
#define vkResetCommandBuffer pcsx2_vkResetCommandBuffer
#define vkCmdBindPipeline pcsx2_vkCmdBindPipeline
#define vkCmdSetViewport pcsx2_vkCmdSetViewport
#define vkCmdSetScissor pcsx2_vkCmdSetScissor
#define vkCmdSetLineWidth pcsx2_vkCmdSetLineWidth
#define vkCmdSetDepthBias pcsx2_vkCmdSetDepthBias
#define vkCmdSetBlendConstants pcsx2_vkCmdSetBlendConstants
#define vkCmdSetDepthBounds pcsx2_vkCmdSetDepthBounds
#define vkCmdSetStencilCompareMask pcsx2_vkCmdSetStencilCompareMask
#define vkCmdSetStencilWriteMask pcsx2_vkCmdSetStencilWriteMask
#define vkCmdSetStencilReference pcsx2_vkCmdSetStencilReference
#define vkCmdBindDescriptorSets pcsx2_vkCmdBindDescriptorSets
#define vkCmdBindIndexBuffer pcsx2_vkCmdBindIndexBuffer
#define vkCmdBindVertexBuffers pcsx2_vkCmdBindVertexBuffers
#define vkCmdDraw pcsx2_vkCmdDraw
#define vkCmdDrawIndexed pcsx2_vkCmdDrawIndexed
#define vkCmdDrawIndirect pcsx2_vkCmdDrawIndirect
#define vkCmdDrawIndexedIndirect pcsx2_vkCmdDrawIndexedIndirect
#define vkCmdDispatch pcsx2_vkCmdDispatch
#define vkCmdDispatchIndirect pcsx2_vkCmdDispatchIndirect
#define vkCmdCopyBuffer pcsx2_vkCmdCopyBuffer
#define vkCmdCopyImage pcsx2_vkCmdCopyImage
#define vkCmdBlitImage pcsx2_vkCmdBlitImage
#define vkCmdCopyBufferToImage pcsx2_vkCmdCopyBufferToImage
#define vkCmdCopyImageToBuffer pcsx2_vkCmdCopyImageToBuffer
#define vkCmdUpdateBuffer pcsx2_vkCmdUpdateBuffer
#define vkCmdFillBuffer pcsx2_vkCmdFillBuffer
#define vkCmdClearColorImage pcsx2_vkCmdClearColorImage
#define vkCmdClearDepthStencilImage pcsx2_vkCmdClearDepthStencilImage
#define vkCmdClearAttachments pcsx2_vkCmdClearAttachments
#define vkCmdResolveImage pcsx2_vkCmdResolveImage
#define vkCmdSetEvent pcsx2_vkCmdSetEvent
#define vkCmdResetEvent pcsx2_vkCmdResetEvent
#define vkCmdWaitEvents pcsx2_vkCmdWaitEvents
#define vkCmdPipelineBarrier pcsx2_vkCmdPipelineBarrier
#define vkCmdBeginQuery pcsx2_vkCmdBeginQuery
#define vkCmdEndQuery pcsx2_vkCmdEndQuery
#define vkCmdResetQueryPool pcsx2_vkCmdResetQueryPool
#define vkCmdWriteTimestamp pcsx2_vkCmdWriteTimestamp
#define vkCmdCopyQueryPoolResults pcsx2_vkCmdCopyQueryPoolResults
#define vkCmdPushConstants pcsx2_vkCmdPushConstants
#define vkCmdBeginRenderPass pcsx2_vkCmdBeginRenderPass
#define vkCmdNextSubpass pcsx2_vkCmdNextSubpass
#define vkCmdEndRenderPass pcsx2_vkCmdEndRenderPass
#define vkCmdExecuteCommands pcsx2_vkCmdExecuteCommands
#define vkCreateSwapchainKHR pcsx2_vkCreateSwapchainKHR
#define vkDestroySwapchainKHR pcsx2_vkDestroySwapchainKHR
#define vkGetSwapchainImagesKHR pcsx2_vkGetSwapchainImagesKHR
#define vkAcquireNextImageKHR pcsx2_vkAcquireNextImageKHR
#define vkQueuePresentKHR pcsx2_vkQueuePresentKHR
// Vulkan 1.1 functions.
#define vkGetBufferMemoryRequirements2 pcsx2_vkGetBufferMemoryRequirements2
#define vkGetImageMemoryRequirements2 pcsx2_vkGetImageMemoryRequirements2
#define vkBindBufferMemory2 pcsx2_vkBindBufferMemory2
#define vkBindImageMemory2 pcsx2_vkBindImageMemory2
#ifdef SUPPORTS_VULKAN_EXCLUSIVE_FULLSCREEN
#define vkAcquireFullScreenExclusiveModeEXT pcsx2_vkAcquireFullScreenExclusiveModeEXT
#define vkReleaseFullScreenExclusiveModeEXT pcsx2_vkReleaseFullScreenExclusiveModeEXT
#endif
// VK_EXT_calibrated_timestamps
#define vkGetCalibratedTimestampsEXT pcsx2_vkGetCalibratedTimestampsEXT
#define vkGetPhysicalDeviceCalibrateableTimeDomainsEXT pcsx2_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT

View File

@ -64,14 +64,6 @@ VULKAN_INSTANCE_ENTRY_POINT(vkGetPhysicalDeviceXlibPresentationSupportKHR, false
VULKAN_INSTANCE_ENTRY_POINT(vkCreateWaylandSurfaceKHR, false)
#endif
#if defined(VK_USE_PLATFORM_ANDROID_KHR)
VULKAN_INSTANCE_ENTRY_POINT(vkCreateAndroidSurfaceKHR, false)
#endif
#if defined(VK_USE_PLATFORM_MACOS_MVK)
VULKAN_INSTANCE_ENTRY_POINT(vkCreateMacOSSurfaceMVK, false)
#endif
#if defined(VK_USE_PLATFORM_METAL_EXT)
VULKAN_INSTANCE_ENTRY_POINT(vkCreateMetalSurfaceEXT, false)
#endif
@ -243,7 +235,7 @@ VULKAN_DEVICE_ENTRY_POINT(vkGetImageMemoryRequirements2, true)
VULKAN_DEVICE_ENTRY_POINT(vkBindBufferMemory2, true)
VULKAN_DEVICE_ENTRY_POINT(vkBindImageMemory2, true)
#ifdef SUPPORTS_VULKAN_EXCLUSIVE_FULLSCREEN
#ifdef _WIN32
VULKAN_DEVICE_ENTRY_POINT(vkAcquireFullScreenExclusiveModeEXT, false)
VULKAN_DEVICE_ENTRY_POINT(vkReleaseFullScreenExclusiveModeEXT, false)
#endif

View File

@ -32,9 +32,9 @@
extern "C" {
#define VULKAN_MODULE_ENTRY_POINT(name, required) PFN_##name pcsx2_##name;
#define VULKAN_INSTANCE_ENTRY_POINT(name, required) PFN_##name pcsx2_##name;
#define VULKAN_DEVICE_ENTRY_POINT(name, required) PFN_##name pcsx2_##name;
#define VULKAN_MODULE_ENTRY_POINT(name, required) PFN_##name name;
#define VULKAN_INSTANCE_ENTRY_POINT(name, required) PFN_##name name;
#define VULKAN_DEVICE_ENTRY_POINT(name, required) PFN_##name name;
#include "VKEntryPoints.inl"
#undef VULKAN_DEVICE_ENTRY_POINT
#undef VULKAN_INSTANCE_ENTRY_POINT
@ -43,9 +43,9 @@ extern "C" {
void Vulkan::ResetVulkanLibraryFunctionPointers()
{
#define VULKAN_MODULE_ENTRY_POINT(name, required) pcsx2_##name = nullptr;
#define VULKAN_INSTANCE_ENTRY_POINT(name, required) pcsx2_##name = nullptr;
#define VULKAN_DEVICE_ENTRY_POINT(name, required) pcsx2_##name = nullptr;
#define VULKAN_MODULE_ENTRY_POINT(name, required) name = nullptr;
#define VULKAN_INSTANCE_ENTRY_POINT(name, required) name = nullptr;
#define VULKAN_DEVICE_ENTRY_POINT(name, required) name = nullptr;
#include "VKEntryPoints.inl"
#undef VULKAN_DEVICE_ENTRY_POINT
#undef VULKAN_INSTANCE_ENTRY_POINT
@ -142,23 +142,13 @@ bool Vulkan::LoadVulkanLibrary()
if (pos != std::string::npos)
{
path.erase(pos);
path += "/../Frameworks/libvulkan.dylib";
path += "/../Frameworks/libMoltenVK.dylib";
vulkan_module = dlopen(path.c_str(), RTLD_NOW);
if (!vulkan_module)
{
path.erase(pos);
path += "/../Frameworks/libMoltenVK.dylib";
vulkan_module = dlopen(path.c_str(), RTLD_NOW);
}
}
}
}
if (!vulkan_module)
{
vulkan_module = dlopen("libvulkan.dylib", RTLD_NOW);
if (!vulkan_module)
vulkan_module = dlopen("libMoltenVK.dylib", RTLD_NOW);
}
#else
// Names of libraries to search. Desktop should use libvulkan.so.1 or libvulkan.so.
static const char* search_lib_names[] = {"libvulkan.so.1", "libvulkan.so"};

View File

@ -17,44 +17,28 @@
#define VK_NO_PROTOTYPES
#if defined(WIN32)
#ifdef _WIN32
#define VK_USE_PLATFORM_WIN32_KHR
#ifndef NOMINMAX
#define NOMINMAX
#endif
// vulkan.h pulls in windows.h on Windows, so we need to include our replacement header first
#include "common/RedtapeWindows.h"
#endif
#if defined(VULKAN_USE_X11)
#if defined(X11_API)
#define VK_USE_PLATFORM_XLIB_KHR
#endif
#if defined(VULKAN_USE_WAYLAND)
#if defined(WAYLAND_API)
#define VK_USE_PLATFORM_WAYLAND_KHR
#endif
#if defined(__ANDROID__)
#define VK_USE_PLATFORM_ANDROID_KHR
#endif
#if defined(__APPLE__)
// #define VK_USE_PLATFORM_MACOS_MVK
#define VK_USE_PLATFORM_METAL_EXT
#endif
#include "vulkan/vulkan.h"
// Currently, exclusive fullscreen is only supported on Windows.
#if defined(WIN32)
#define SUPPORTS_VULKAN_EXCLUSIVE_FULLSCREEN 1
#endif
#if defined(VULKAN_USE_X11)
#if defined(X11_API)
// This breaks a bunch of our code. They shouldn't be #defines in the first place.
#ifdef None

View File

@ -131,22 +131,6 @@ VkSurfaceKHR VKSwapChain::CreateVulkanSurface(VkInstance instance, VkPhysicalDev
return VK_NULL_HANDLE;
}
return surface;
}
#elif defined(VK_USE_PLATFORM_MACOS_MVK)
if (wi->type == WindowInfo::Type::MacOS)
{
VkMacOSSurfaceCreateInfoMVK surface_create_info = {
VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK, nullptr, 0, wi->window_handle};
VkSurfaceKHR surface;
VkResult res = vkCreateMacOSSurfaceMVK(instance, &surface_create_info, nullptr, &surface);
if (res != VK_SUCCESS)
{
LOG_VULKAN_ERROR(res, "vkCreateMacOSSurfaceMVK failed: ");
return VK_NULL_HANDLE;
}
return surface;
}
#endif