|
|
|
@ -9,6 +9,7 @@
|
|
|
|
|
|
|
|
|
|
#include "common/common_types.h"
|
|
|
|
|
#include "common/logging/log.h"
|
|
|
|
|
#include "video_core/vulkan_common/vk_enum_string_helper.h"
|
|
|
|
|
#include "video_core/vulkan_common/vma.h"
|
|
|
|
|
#include "video_core/vulkan_common/vulkan_wrapper.h"
|
|
|
|
|
|
|
|
|
@ -298,109 +299,7 @@ bool Load(VkInstance instance, InstanceDispatch& dld) noexcept {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char* Exception::what() const noexcept {
|
|
|
|
|
return ToString(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char* ToString(VkResult result) noexcept {
|
|
|
|
|
switch (result) {
|
|
|
|
|
case VkResult::VK_SUCCESS:
|
|
|
|
|
return "VK_SUCCESS";
|
|
|
|
|
case VkResult::VK_NOT_READY:
|
|
|
|
|
return "VK_NOT_READY";
|
|
|
|
|
case VkResult::VK_TIMEOUT:
|
|
|
|
|
return "VK_TIMEOUT";
|
|
|
|
|
case VkResult::VK_EVENT_SET:
|
|
|
|
|
return "VK_EVENT_SET";
|
|
|
|
|
case VkResult::VK_EVENT_RESET:
|
|
|
|
|
return "VK_EVENT_RESET";
|
|
|
|
|
case VkResult::VK_INCOMPLETE:
|
|
|
|
|
return "VK_INCOMPLETE";
|
|
|
|
|
case VkResult::VK_ERROR_OUT_OF_HOST_MEMORY:
|
|
|
|
|
return "VK_ERROR_OUT_OF_HOST_MEMORY";
|
|
|
|
|
case VkResult::VK_ERROR_OUT_OF_DEVICE_MEMORY:
|
|
|
|
|
return "VK_ERROR_OUT_OF_DEVICE_MEMORY";
|
|
|
|
|
case VkResult::VK_ERROR_INITIALIZATION_FAILED:
|
|
|
|
|
return "VK_ERROR_INITIALIZATION_FAILED";
|
|
|
|
|
case VkResult::VK_ERROR_DEVICE_LOST:
|
|
|
|
|
return "VK_ERROR_DEVICE_LOST";
|
|
|
|
|
case VkResult::VK_ERROR_MEMORY_MAP_FAILED:
|
|
|
|
|
return "VK_ERROR_MEMORY_MAP_FAILED";
|
|
|
|
|
case VkResult::VK_ERROR_LAYER_NOT_PRESENT:
|
|
|
|
|
return "VK_ERROR_LAYER_NOT_PRESENT";
|
|
|
|
|
case VkResult::VK_ERROR_EXTENSION_NOT_PRESENT:
|
|
|
|
|
return "VK_ERROR_EXTENSION_NOT_PRESENT";
|
|
|
|
|
case VkResult::VK_ERROR_FEATURE_NOT_PRESENT:
|
|
|
|
|
return "VK_ERROR_FEATURE_NOT_PRESENT";
|
|
|
|
|
case VkResult::VK_ERROR_INCOMPATIBLE_DRIVER:
|
|
|
|
|
return "VK_ERROR_INCOMPATIBLE_DRIVER";
|
|
|
|
|
case VkResult::VK_ERROR_TOO_MANY_OBJECTS:
|
|
|
|
|
return "VK_ERROR_TOO_MANY_OBJECTS";
|
|
|
|
|
case VkResult::VK_ERROR_FORMAT_NOT_SUPPORTED:
|
|
|
|
|
return "VK_ERROR_FORMAT_NOT_SUPPORTED";
|
|
|
|
|
case VkResult::VK_ERROR_FRAGMENTED_POOL:
|
|
|
|
|
return "VK_ERROR_FRAGMENTED_POOL";
|
|
|
|
|
case VkResult::VK_ERROR_OUT_OF_POOL_MEMORY:
|
|
|
|
|
return "VK_ERROR_OUT_OF_POOL_MEMORY";
|
|
|
|
|
case VkResult::VK_ERROR_INVALID_EXTERNAL_HANDLE:
|
|
|
|
|
return "VK_ERROR_INVALID_EXTERNAL_HANDLE";
|
|
|
|
|
case VkResult::VK_ERROR_SURFACE_LOST_KHR:
|
|
|
|
|
return "VK_ERROR_SURFACE_LOST_KHR";
|
|
|
|
|
case VkResult::VK_ERROR_NATIVE_WINDOW_IN_USE_KHR:
|
|
|
|
|
return "VK_ERROR_NATIVE_WINDOW_IN_USE_KHR";
|
|
|
|
|
case VkResult::VK_SUBOPTIMAL_KHR:
|
|
|
|
|
return "VK_SUBOPTIMAL_KHR";
|
|
|
|
|
case VkResult::VK_ERROR_OUT_OF_DATE_KHR:
|
|
|
|
|
return "VK_ERROR_OUT_OF_DATE_KHR";
|
|
|
|
|
case VkResult::VK_ERROR_INCOMPATIBLE_DISPLAY_KHR:
|
|
|
|
|
return "VK_ERROR_INCOMPATIBLE_DISPLAY_KHR";
|
|
|
|
|
case VkResult::VK_ERROR_VALIDATION_FAILED_EXT:
|
|
|
|
|
return "VK_ERROR_VALIDATION_FAILED_EXT";
|
|
|
|
|
case VkResult::VK_ERROR_INVALID_SHADER_NV:
|
|
|
|
|
return "VK_ERROR_INVALID_SHADER_NV";
|
|
|
|
|
case VkResult::VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR:
|
|
|
|
|
return "VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR";
|
|
|
|
|
case VkResult::VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR:
|
|
|
|
|
return "VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR";
|
|
|
|
|
case VkResult::VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR:
|
|
|
|
|
return "VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR";
|
|
|
|
|
case VkResult::VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR:
|
|
|
|
|
return "VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR";
|
|
|
|
|
case VkResult::VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR:
|
|
|
|
|
return "VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR";
|
|
|
|
|
case VkResult::VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR:
|
|
|
|
|
return "VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR";
|
|
|
|
|
case VkResult::VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT:
|
|
|
|
|
return "VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT";
|
|
|
|
|
case VkResult::VK_ERROR_FRAGMENTATION_EXT:
|
|
|
|
|
return "VK_ERROR_FRAGMENTATION_EXT";
|
|
|
|
|
case VkResult::VK_ERROR_NOT_PERMITTED_EXT:
|
|
|
|
|
return "VK_ERROR_NOT_PERMITTED_EXT";
|
|
|
|
|
case VkResult::VK_ERROR_INVALID_DEVICE_ADDRESS_EXT:
|
|
|
|
|
return "VK_ERROR_INVALID_DEVICE_ADDRESS_EXT";
|
|
|
|
|
case VkResult::VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT:
|
|
|
|
|
return "VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT";
|
|
|
|
|
case VkResult::VK_ERROR_UNKNOWN:
|
|
|
|
|
return "VK_ERROR_UNKNOWN";
|
|
|
|
|
case VkResult::VK_THREAD_IDLE_KHR:
|
|
|
|
|
return "VK_THREAD_IDLE_KHR";
|
|
|
|
|
case VkResult::VK_THREAD_DONE_KHR:
|
|
|
|
|
return "VK_THREAD_DONE_KHR";
|
|
|
|
|
case VkResult::VK_OPERATION_DEFERRED_KHR:
|
|
|
|
|
return "VK_OPERATION_DEFERRED_KHR";
|
|
|
|
|
case VkResult::VK_OPERATION_NOT_DEFERRED_KHR:
|
|
|
|
|
return "VK_OPERATION_NOT_DEFERRED_KHR";
|
|
|
|
|
case VkResult::VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR:
|
|
|
|
|
return "VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR";
|
|
|
|
|
case VkResult::VK_PIPELINE_COMPILE_REQUIRED_EXT:
|
|
|
|
|
return "VK_PIPELINE_COMPILE_REQUIRED_EXT";
|
|
|
|
|
case VkResult::VK_RESULT_MAX_ENUM:
|
|
|
|
|
return "VK_RESULT_MAX_ENUM";
|
|
|
|
|
case VkResult::VK_ERROR_COMPRESSION_EXHAUSTED_EXT:
|
|
|
|
|
return "VK_ERROR_COMPRESSION_EXHAUSTED_EXT";
|
|
|
|
|
case VkResult::VK_ERROR_INCOMPATIBLE_SHADER_BINARY_EXT:
|
|
|
|
|
return "VK_ERROR_INCOMPATIBLE_SHADER_BINARY_EXT";
|
|
|
|
|
}
|
|
|
|
|
return "Unknown";
|
|
|
|
|
return string_VkResult(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Destroy(VkInstance instance, const InstanceDispatch& dld) noexcept {
|
|
|
|
@ -1067,7 +966,7 @@ u32 AvailableVersion(const InstanceDispatch& dld) noexcept {
|
|
|
|
|
u32 version;
|
|
|
|
|
if (const VkResult result = vkEnumerateInstanceVersion(&version); result != VK_SUCCESS) {
|
|
|
|
|
LOG_ERROR(Render_Vulkan, "vkEnumerateInstanceVersion returned {}, assuming Vulkan 1.1",
|
|
|
|
|
ToString(result));
|
|
|
|
|
string_VkResult(result));
|
|
|
|
|
return VK_API_VERSION_1_1;
|
|
|
|
|
}
|
|
|
|
|
return version;
|
|
|
|
|