diff options
| author | 2023-08-02 14:26:03 -0400 | |
|---|---|---|
| committer | 2023-08-02 14:26:03 -0400 | |
| commit | 096644c01cb8cd30589d5f168fdabaac5aad174a (patch) | |
| tree | 92ed30b541d5864f4b8a50b45a048ddc642042c9 /src/video_core/vulkan_common | |
| parent | Merge pull request #10839 from lat9nq/pgc-plus (diff) | |
| parent | vulkan: centralize config (diff) | |
| download | yuzu-096644c01cb8cd30589d5f168fdabaac5aad174a.tar.gz yuzu-096644c01cb8cd30589d5f168fdabaac5aad174a.tar.xz yuzu-096644c01cb8cd30589d5f168fdabaac5aad174a.zip | |
Merge pull request #11202 from abouvier/vulkan-config
vulkan: centralize config
Diffstat (limited to 'src/video_core/vulkan_common')
| -rw-r--r-- | src/video_core/vulkan_common/vulkan.h | 13 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_instance.cpp | 13 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_surface.cpp | 13 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_wrapper.h | 8 |
4 files changed, 13 insertions, 34 deletions
diff --git a/src/video_core/vulkan_common/vulkan.h b/src/video_core/vulkan_common/vulkan.h index 3fa963647..62aa13291 100644 --- a/src/video_core/vulkan_common/vulkan.h +++ b/src/video_core/vulkan_common/vulkan.h | |||
| @@ -8,6 +8,19 @@ | |||
| 8 | #define VK_USE_PLATFORM_WIN32_KHR | 8 | #define VK_USE_PLATFORM_WIN32_KHR |
| 9 | #elif defined(__APPLE__) | 9 | #elif defined(__APPLE__) |
| 10 | #define VK_USE_PLATFORM_METAL_EXT | 10 | #define VK_USE_PLATFORM_METAL_EXT |
| 11 | #elif defined(__ANDROID__) | ||
| 12 | #define VK_USE_PLATFORM_ANDROID_KHR | ||
| 13 | #else | ||
| 14 | #define VK_USE_PLATFORM_XLIB_KHR | ||
| 15 | #define VK_USE_PLATFORM_WAYLAND_KHR | ||
| 11 | #endif | 16 | #endif |
| 12 | 17 | ||
| 13 | #include <vulkan/vulkan.h> | 18 | #include <vulkan/vulkan.h> |
| 19 | |||
| 20 | // Sanitize macros | ||
| 21 | #undef CreateEvent | ||
| 22 | #undef CreateSemaphore | ||
| 23 | #undef Always | ||
| 24 | #undef False | ||
| 25 | #undef None | ||
| 26 | #undef True | ||
diff --git a/src/video_core/vulkan_common/vulkan_instance.cpp b/src/video_core/vulkan_common/vulkan_instance.cpp index 6a294c1da..72aedb8d8 100644 --- a/src/video_core/vulkan_common/vulkan_instance.cpp +++ b/src/video_core/vulkan_common/vulkan_instance.cpp | |||
| @@ -14,19 +14,6 @@ | |||
| 14 | #include "video_core/vulkan_common/vulkan_instance.h" | 14 | #include "video_core/vulkan_common/vulkan_instance.h" |
| 15 | #include "video_core/vulkan_common/vulkan_wrapper.h" | 15 | #include "video_core/vulkan_common/vulkan_wrapper.h" |
| 16 | 16 | ||
| 17 | // Include these late to avoid polluting previous headers | ||
| 18 | #if defined(_WIN32) | ||
| 19 | #include <windows.h> | ||
| 20 | // ensure include order | ||
| 21 | #include <vulkan/vulkan_win32.h> | ||
| 22 | #elif defined(__ANDROID__) | ||
| 23 | #include <vulkan/vulkan_android.h> | ||
| 24 | #elif !defined(__APPLE__) | ||
| 25 | #include <X11/Xlib.h> | ||
| 26 | #include <vulkan/vulkan_wayland.h> | ||
| 27 | #include <vulkan/vulkan_xlib.h> | ||
| 28 | #endif | ||
| 29 | |||
| 30 | namespace Vulkan { | 17 | namespace Vulkan { |
| 31 | namespace { | 18 | namespace { |
| 32 | 19 | ||
diff --git a/src/video_core/vulkan_common/vulkan_surface.cpp b/src/video_core/vulkan_common/vulkan_surface.cpp index cfea4cd7b..e45f8e43f 100644 --- a/src/video_core/vulkan_common/vulkan_surface.cpp +++ b/src/video_core/vulkan_common/vulkan_surface.cpp | |||
| @@ -6,19 +6,6 @@ | |||
| 6 | #include "video_core/vulkan_common/vulkan_surface.h" | 6 | #include "video_core/vulkan_common/vulkan_surface.h" |
| 7 | #include "video_core/vulkan_common/vulkan_wrapper.h" | 7 | #include "video_core/vulkan_common/vulkan_wrapper.h" |
| 8 | 8 | ||
| 9 | // Include these late to avoid polluting previous headers | ||
| 10 | #ifdef _WIN32 | ||
| 11 | #include <windows.h> | ||
| 12 | // ensure include order | ||
| 13 | #include <vulkan/vulkan_win32.h> | ||
| 14 | #elif defined(__ANDROID__) | ||
| 15 | #include <vulkan/vulkan_android.h> | ||
| 16 | #elif !defined(__APPLE__) | ||
| 17 | #include <X11/Xlib.h> | ||
| 18 | #include <vulkan/vulkan_wayland.h> | ||
| 19 | #include <vulkan/vulkan_xlib.h> | ||
| 20 | #endif | ||
| 21 | |||
| 22 | namespace Vulkan { | 9 | namespace Vulkan { |
| 23 | 10 | ||
| 24 | vk::SurfaceKHR CreateSurface( | 11 | vk::SurfaceKHR CreateSurface( |
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 3089c3d41..c226a2a29 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h | |||
| @@ -15,14 +15,6 @@ | |||
| 15 | #include "common/common_types.h" | 15 | #include "common/common_types.h" |
| 16 | #include "video_core/vulkan_common/vulkan.h" | 16 | #include "video_core/vulkan_common/vulkan.h" |
| 17 | 17 | ||
| 18 | // Sanitize macros | ||
| 19 | #ifdef CreateEvent | ||
| 20 | #undef CreateEvent | ||
| 21 | #endif | ||
| 22 | #ifdef CreateSemaphore | ||
| 23 | #undef CreateSemaphore | ||
| 24 | #endif | ||
| 25 | |||
| 26 | #ifdef _MSC_VER | 18 | #ifdef _MSC_VER |
| 27 | #pragma warning(disable : 26812) // Disable prefer enum class over enum | 19 | #pragma warning(disable : 26812) // Disable prefer enum class over enum |
| 28 | #endif | 20 | #endif |