2016-08-13 12:57:50 +00:00
|
|
|
// Copyright 2016 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2016-08-13 12:57:50 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#define VK_NO_PROTOTYPES
|
|
|
|
|
2020-08-19 06:25:57 +00:00
|
|
|
#if defined(_WIN32)
|
2016-08-13 12:57:50 +00:00
|
|
|
#define VK_USE_PLATFORM_WIN32_KHR
|
2018-10-24 04:47:48 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_X11)
|
2016-08-13 12:57:50 +00:00
|
|
|
#define VK_USE_PLATFORM_XLIB_KHR
|
2018-10-24 04:47:48 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(ANDROID)
|
2016-08-13 12:57:50 +00:00
|
|
|
#define VK_USE_PLATFORM_ANDROID_KHR
|
2018-10-24 04:47:48 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__APPLE__)
|
2020-04-07 08:49:40 +00:00
|
|
|
#define VK_USE_PLATFORM_METAL_EXT
|
2016-08-13 12:57:50 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "vulkan/vulkan.h"
|
|
|
|
|
2019-09-30 15:10:08 +00:00
|
|
|
// Currently, exclusive fullscreen is only supported on Windows.
|
|
|
|
#if defined(WIN32)
|
|
|
|
#define SUPPORTS_VULKAN_EXCLUSIVE_FULLSCREEN 1
|
|
|
|
#endif
|
|
|
|
|
2016-08-13 12:57:50 +00:00
|
|
|
// We abuse the preprocessor here to only need to specify function names once.
|
|
|
|
#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 "VideoBackends/Vulkan/VulkanEntryPoints.inl"
|
|
|
|
#undef VULKAN_DEVICE_ENTRY_POINT
|
|
|
|
#undef VULKAN_INSTANCE_ENTRY_POINT
|
|
|
|
#undef VULKAN_MODULE_ENTRY_POINT
|
|
|
|
|
2021-10-21 19:11:07 +00:00
|
|
|
#include "Common/Logging/Log.h"
|
|
|
|
|
2016-08-13 12:57:50 +00:00
|
|
|
namespace Vulkan
|
|
|
|
{
|
|
|
|
bool LoadVulkanLibrary();
|
|
|
|
bool LoadVulkanInstanceFunctions(VkInstance instance);
|
|
|
|
bool LoadVulkanDeviceFunctions(VkDevice device);
|
|
|
|
void UnloadVulkanLibrary();
|
|
|
|
|
|
|
|
const char* VkResultToString(VkResult res);
|
2021-10-21 19:11:07 +00:00
|
|
|
void LogVulkanResult(Common::Log::LogLevel level, const char* func_name, VkResult res,
|
|
|
|
const char* msg, ...);
|
2016-08-13 12:57:50 +00:00
|
|
|
|
2021-10-21 19:11:07 +00:00
|
|
|
#define LOG_VULKAN_ERROR(res, ...) \
|
|
|
|
LogVulkanResult(Common::Log::LogLevel::LERROR, __func__, res, __VA_ARGS__)
|
2016-08-13 12:57:50 +00:00
|
|
|
|
|
|
|
} // namespace Vulkan
|