2016-08-13 06:57:50 -06:00
|
|
|
// Copyright 2016 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#define VK_NO_PROTOTYPES
|
|
|
|
|
|
|
|
#if defined(WIN32)
|
|
|
|
#define VK_USE_PLATFORM_WIN32_KHR
|
2018-10-23 22:47:48 -06:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_X11)
|
2016-08-13 06:57:50 -06:00
|
|
|
#define VK_USE_PLATFORM_XLIB_KHR
|
2018-10-23 22:47:48 -06:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(ANDROID)
|
2016-08-13 06:57:50 -06:00
|
|
|
#define VK_USE_PLATFORM_ANDROID_KHR
|
2018-10-23 22:47:48 -06:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__APPLE__)
|
2018-05-31 05:23:45 -06:00
|
|
|
#define VK_USE_PLATFORM_MACOS_MVK
|
2016-08-13 06:57:50 -06:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "vulkan/vulkan.h"
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
|
namespace Vulkan
|
|
|
|
{
|
|
|
|
bool LoadVulkanLibrary();
|
|
|
|
bool LoadVulkanInstanceFunctions(VkInstance instance);
|
|
|
|
bool LoadVulkanDeviceFunctions(VkDevice device);
|
|
|
|
void UnloadVulkanLibrary();
|
|
|
|
|
|
|
|
const char* VkResultToString(VkResult res);
|
|
|
|
void LogVulkanResult(int level, const char* func_name, VkResult res, const char* msg, ...);
|
|
|
|
|
2018-03-16 11:27:11 -06:00
|
|
|
#define LOG_VULKAN_ERROR(res, ...) LogVulkanResult(2, __func__, res, __VA_ARGS__)
|
2016-08-13 06:57:50 -06:00
|
|
|
|
|
|
|
} // namespace Vulkan
|