diff options
| -rw-r--r-- | CMakeLists.txt | 20 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/applet_mii_edit.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/mii/mii_manager.cpp | 12 | ||||
| -rw-r--r-- | src/core/hle/service/mii/mii_manager.h | 1 | ||||
| -rw-r--r-- | src/core/hle/service/mii/raw_data.cpp | 105 | ||||
| -rw-r--r-- | src/core/hle/service/mii/raw_data.h | 1 | ||||
| -rw-r--r-- | src/core/hle/service/nfc/common/device.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/renderer_vulkan.cpp | 18 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/renderer_vulkan.h | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_buffer_cache.cpp | 11 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_debug_callback.cpp | 27 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_debug_callback.h | 2 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_instance.cpp | 8 |
13 files changed, 151 insertions, 64 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4039c680e..c6b158985 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -49,6 +49,8 @@ option(YUZU_TESTS "Compile tests" "${BUILD_TESTING}") | |||
| 49 | 49 | ||
| 50 | option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON) | 50 | option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON) |
| 51 | 51 | ||
| 52 | option(YUZU_DOWNLOAD_ANDROID_VVL "Download validation layer binary for android" ON) | ||
| 53 | |||
| 52 | CMAKE_DEPENDENT_OPTION(YUZU_ROOM "Compile LDN room server" ON "NOT ANDROID" OFF) | 54 | CMAKE_DEPENDENT_OPTION(YUZU_ROOM "Compile LDN room server" ON "NOT ANDROID" OFF) |
| 53 | 55 | ||
| 54 | CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile Windows crash dump (Minidump) support" OFF "WIN32" OFF) | 56 | CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile Windows crash dump (Minidump) support" OFF "WIN32" OFF) |
| @@ -77,6 +79,24 @@ if (ANDROID OR WIN32 OR APPLE) | |||
| 77 | endif() | 79 | endif() |
| 78 | option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL}) | 80 | option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL}) |
| 79 | 81 | ||
| 82 | if (ANDROID AND YUZU_DOWNLOAD_ANDROID_VVL) | ||
| 83 | set(vvl_version "sdk-1.3.261.1") | ||
| 84 | set(vvl_zip_file "${CMAKE_BINARY_DIR}/externals/vvl-android.zip") | ||
| 85 | if (NOT EXISTS "${vvl_zip_file}") | ||
| 86 | # Download and extract validation layer release to externals directory | ||
| 87 | set(vvl_base_url "https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/download") | ||
| 88 | file(DOWNLOAD "${vvl_base_url}/${vvl_version}/android-binaries-${vvl_version}-android.zip" | ||
| 89 | "${vvl_zip_file}" SHOW_PROGRESS) | ||
| 90 | execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${vvl_zip_file}" | ||
| 91 | WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals") | ||
| 92 | endif() | ||
| 93 | |||
| 94 | # Copy the arm64 binary to src/android/app/main/jniLibs | ||
| 95 | set(vvl_lib_path "${CMAKE_CURRENT_SOURCE_DIR}/src/android/app/src/main/jniLibs/arm64-v8a/") | ||
| 96 | file(COPY "${CMAKE_BINARY_DIR}/externals/android-binaries-${vvl_version}/arm64-v8a/libVkLayer_khronos_validation.so" | ||
| 97 | DESTINATION "${vvl_lib_path}") | ||
| 98 | endif() | ||
| 99 | |||
| 80 | # On Android, fetch and compile libcxx before doing anything else | 100 | # On Android, fetch and compile libcxx before doing anything else |
| 81 | if (ANDROID) | 101 | if (ANDROID) |
| 82 | set(CMAKE_SKIP_INSTALL_RULES ON) | 102 | set(CMAKE_SKIP_INSTALL_RULES ON) |
diff --git a/src/core/hle/service/am/applets/applet_mii_edit.cpp b/src/core/hle/service/am/applets/applet_mii_edit.cpp index d1f652c09..f8e2bac32 100644 --- a/src/core/hle/service/am/applets/applet_mii_edit.cpp +++ b/src/core/hle/service/am/applets/applet_mii_edit.cpp | |||
| @@ -90,7 +90,7 @@ void MiiEdit::Execute() { | |||
| 90 | const MiiEditCharInfo char_info{ | 90 | const MiiEditCharInfo char_info{ |
| 91 | .mii_info{applet_input_common.applet_mode == MiiEditAppletMode::EditMii | 91 | .mii_info{applet_input_common.applet_mode == MiiEditAppletMode::EditMii |
| 92 | ? applet_input_v4.char_info.mii_info | 92 | ? applet_input_v4.char_info.mii_info |
| 93 | : mii_manager.BuildDefault(0)}, | 93 | : mii_manager.BuildBase(Mii::Gender::Male)}, |
| 94 | }; | 94 | }; |
| 95 | 95 | ||
| 96 | MiiEditOutputForCharInfoEditing(MiiEditResult::Success, char_info); | 96 | MiiEditOutputForCharInfoEditing(MiiEditResult::Success, char_info); |
diff --git a/src/core/hle/service/mii/mii_manager.cpp b/src/core/hle/service/mii/mii_manager.cpp index 6b966f20d..dd632df50 100644 --- a/src/core/hle/service/mii/mii_manager.cpp +++ b/src/core/hle/service/mii/mii_manager.cpp | |||
| @@ -18,7 +18,6 @@ namespace { | |||
| 18 | 18 | ||
| 19 | constexpr Result ERROR_CANNOT_FIND_ENTRY{ErrorModule::Mii, 4}; | 19 | constexpr Result ERROR_CANNOT_FIND_ENTRY{ErrorModule::Mii, 4}; |
| 20 | 20 | ||
| 21 | constexpr std::size_t BaseMiiCount{2}; | ||
| 22 | constexpr std::size_t DefaultMiiCount{RawData::DefaultMii.size()}; | 21 | constexpr std::size_t DefaultMiiCount{RawData::DefaultMii.size()}; |
| 23 | 22 | ||
| 24 | constexpr MiiStoreData::Name DefaultMiiName{u'n', u'o', u' ', u'n', u'a', u'm', u'e'}; | 23 | constexpr MiiStoreData::Name DefaultMiiName{u'n', u'o', u' ', u'n', u'a', u'm', u'e'}; |
| @@ -404,7 +403,7 @@ u32 MiiManager::GetCount(SourceFlag source_flag) const { | |||
| 404 | count += 0; | 403 | count += 0; |
| 405 | } | 404 | } |
| 406 | if ((source_flag & SourceFlag::Default) != SourceFlag::None) { | 405 | if ((source_flag & SourceFlag::Default) != SourceFlag::None) { |
| 407 | count += (DefaultMiiCount - BaseMiiCount); | 406 | count += DefaultMiiCount; |
| 408 | } | 407 | } |
| 409 | return static_cast<u32>(count); | 408 | return static_cast<u32>(count); |
| 410 | } | 409 | } |
| @@ -422,13 +421,18 @@ CharInfo MiiManager::BuildRandom(Age age, Gender gender, Race race) { | |||
| 422 | return ConvertStoreDataToInfo(BuildRandomStoreData(age, gender, race, user_id)); | 421 | return ConvertStoreDataToInfo(BuildRandomStoreData(age, gender, race, user_id)); |
| 423 | } | 422 | } |
| 424 | 423 | ||
| 424 | CharInfo MiiManager::BuildBase(Gender gender) { | ||
| 425 | const std::size_t index = gender == Gender::Female ? 1 : 0; | ||
| 426 | return ConvertStoreDataToInfo(BuildDefaultStoreData(RawData::BaseMii.at(index), user_id)); | ||
| 427 | } | ||
| 428 | |||
| 425 | CharInfo MiiManager::BuildDefault(std::size_t index) { | 429 | CharInfo MiiManager::BuildDefault(std::size_t index) { |
| 426 | return ConvertStoreDataToInfo(BuildDefaultStoreData(RawData::DefaultMii.at(index), user_id)); | 430 | return ConvertStoreDataToInfo(BuildDefaultStoreData(RawData::DefaultMii.at(index), user_id)); |
| 427 | } | 431 | } |
| 428 | 432 | ||
| 429 | CharInfo MiiManager::ConvertV3ToCharInfo(const Ver3StoreData& mii_v3) const { | 433 | CharInfo MiiManager::ConvertV3ToCharInfo(const Ver3StoreData& mii_v3) const { |
| 430 | Service::Mii::MiiManager manager; | 434 | Service::Mii::MiiManager manager; |
| 431 | auto mii = manager.BuildDefault(0); | 435 | auto mii = manager.BuildBase(Mii::Gender::Male); |
| 432 | 436 | ||
| 433 | if (!ValidateV3Info(mii_v3)) { | 437 | if (!ValidateV3Info(mii_v3)) { |
| 434 | return mii; | 438 | return mii; |
| @@ -678,7 +682,7 @@ std::vector<MiiInfoElement> MiiManager::GetDefault(SourceFlag source_flag) { | |||
| 678 | return result; | 682 | return result; |
| 679 | } | 683 | } |
| 680 | 684 | ||
| 681 | for (std::size_t index = BaseMiiCount; index < DefaultMiiCount; index++) { | 685 | for (std::size_t index = 0; index < DefaultMiiCount; index++) { |
| 682 | result.emplace_back(BuildDefault(index), Source::Default); | 686 | result.emplace_back(BuildDefault(index), Source::Default); |
| 683 | } | 687 | } |
| 684 | 688 | ||
diff --git a/src/core/hle/service/mii/mii_manager.h b/src/core/hle/service/mii/mii_manager.h index 45c2be3c8..0c8295ebe 100644 --- a/src/core/hle/service/mii/mii_manager.h +++ b/src/core/hle/service/mii/mii_manager.h | |||
| @@ -21,6 +21,7 @@ public: | |||
| 21 | u32 GetCount(SourceFlag source_flag) const; | 21 | u32 GetCount(SourceFlag source_flag) const; |
| 22 | Result UpdateLatest(CharInfo* out_info, const CharInfo& info, SourceFlag source_flag); | 22 | Result UpdateLatest(CharInfo* out_info, const CharInfo& info, SourceFlag source_flag); |
| 23 | CharInfo BuildRandom(Age age, Gender gender, Race race); | 23 | CharInfo BuildRandom(Age age, Gender gender, Race race); |
| 24 | CharInfo BuildBase(Gender gender); | ||
| 24 | CharInfo BuildDefault(std::size_t index); | 25 | CharInfo BuildDefault(std::size_t index); |
| 25 | CharInfo ConvertV3ToCharInfo(const Ver3StoreData& mii_v3) const; | 26 | CharInfo ConvertV3ToCharInfo(const Ver3StoreData& mii_v3) const; |
| 26 | bool ValidateV3Info(const Ver3StoreData& mii_v3) const; | 27 | bool ValidateV3Info(const Ver3StoreData& mii_v3) const; |
diff --git a/src/core/hle/service/mii/raw_data.cpp b/src/core/hle/service/mii/raw_data.cpp index 80369cdb0..e5245b791 100644 --- a/src/core/hle/service/mii/raw_data.cpp +++ b/src/core/hle/service/mii/raw_data.cpp | |||
| @@ -5,6 +5,111 @@ | |||
| 5 | 5 | ||
| 6 | namespace Service::Mii::RawData { | 6 | namespace Service::Mii::RawData { |
| 7 | 7 | ||
| 8 | const std::array<Service::Mii::DefaultMii, 2> BaseMii{ | ||
| 9 | Service::Mii::DefaultMii{ | ||
| 10 | .face_type = 0, | ||
| 11 | .face_color = 0, | ||
| 12 | .face_wrinkle = 0, | ||
| 13 | .face_makeup = 0, | ||
| 14 | .hair_type = 33, | ||
| 15 | .hair_color = 1, | ||
| 16 | .hair_flip = 0, | ||
| 17 | .eye_type = 2, | ||
| 18 | .eye_color = 0, | ||
| 19 | .eye_scale = 4, | ||
| 20 | .eye_aspect = 3, | ||
| 21 | .eye_rotate = 4, | ||
| 22 | .eye_x = 2, | ||
| 23 | .eye_y = 12, | ||
| 24 | .eyebrow_type = 6, | ||
| 25 | .eyebrow_color = 1, | ||
| 26 | .eyebrow_scale = 4, | ||
| 27 | .eyebrow_aspect = 3, | ||
| 28 | .eyebrow_rotate = 6, | ||
| 29 | .eyebrow_x = 2, | ||
| 30 | .eyebrow_y = 10, | ||
| 31 | .nose_type = 1, | ||
| 32 | .nose_scale = 4, | ||
| 33 | .nose_y = 9, | ||
| 34 | .mouth_type = 23, | ||
| 35 | .mouth_color = 0, | ||
| 36 | .mouth_scale = 4, | ||
| 37 | .mouth_aspect = 3, | ||
| 38 | .mouth_y = 13, | ||
| 39 | .mustache_type = 0, | ||
| 40 | .beard_type = 0, | ||
| 41 | .beard_color = 0, | ||
| 42 | .mustache_scale = 4, | ||
| 43 | .mustache_y = 10, | ||
| 44 | .glasses_type = 0, | ||
| 45 | .glasses_color = 0, | ||
| 46 | .glasses_scale = 4, | ||
| 47 | .glasses_y = 10, | ||
| 48 | .mole_type = 0, | ||
| 49 | .mole_scale = 4, | ||
| 50 | .mole_x = 2, | ||
| 51 | .mole_y = 20, | ||
| 52 | .height = 64, | ||
| 53 | .weight = 64, | ||
| 54 | .gender = Gender::Male, | ||
| 55 | .favorite_color = 0, | ||
| 56 | .region = 0, | ||
| 57 | .font_region = FontRegion::Standard, | ||
| 58 | .type = 0, | ||
| 59 | }, | ||
| 60 | Service::Mii::DefaultMii{ | ||
| 61 | .face_type = 0, | ||
| 62 | .face_color = 0, | ||
| 63 | .face_wrinkle = 0, | ||
| 64 | .face_makeup = 0, | ||
| 65 | .hair_type = 12, | ||
| 66 | .hair_color = 1, | ||
| 67 | .hair_flip = 0, | ||
| 68 | .eye_type = 4, | ||
| 69 | .eye_color = 0, | ||
| 70 | .eye_scale = 4, | ||
| 71 | .eye_aspect = 3, | ||
| 72 | .eye_rotate = 3, | ||
| 73 | .eye_x = 2, | ||
| 74 | .eye_y = 12, | ||
| 75 | .eyebrow_type = 0, | ||
| 76 | .eyebrow_color = 1, | ||
| 77 | .eyebrow_scale = 4, | ||
| 78 | .eyebrow_aspect = 3, | ||
| 79 | .eyebrow_rotate = 6, | ||
| 80 | .eyebrow_x = 2, | ||
| 81 | .eyebrow_y = 10, | ||
| 82 | .nose_type = 1, | ||
| 83 | .nose_scale = 4, | ||
| 84 | .nose_y = 9, | ||
| 85 | .mouth_type = 23, | ||
| 86 | .mouth_color = 0, | ||
| 87 | .mouth_scale = 4, | ||
| 88 | .mouth_aspect = 3, | ||
| 89 | .mouth_y = 13, | ||
| 90 | .mustache_type = 0, | ||
| 91 | .beard_type = 0, | ||
| 92 | .beard_color = 0, | ||
| 93 | .mustache_scale = 4, | ||
| 94 | .mustache_y = 10, | ||
| 95 | .glasses_type = 0, | ||
| 96 | .glasses_color = 0, | ||
| 97 | .glasses_scale = 4, | ||
| 98 | .glasses_y = 10, | ||
| 99 | .mole_type = 0, | ||
| 100 | .mole_scale = 4, | ||
| 101 | .mole_x = 2, | ||
| 102 | .mole_y = 20, | ||
| 103 | .height = 64, | ||
| 104 | .weight = 64, | ||
| 105 | .gender = Gender::Female, | ||
| 106 | .favorite_color = 0, | ||
| 107 | .region = 0, | ||
| 108 | .font_region = FontRegion::Standard, | ||
| 109 | .type = 0, | ||
| 110 | }, | ||
| 111 | }; | ||
| 112 | |||
| 8 | const std::array<Service::Mii::DefaultMii, 6> DefaultMii{ | 113 | const std::array<Service::Mii::DefaultMii, 6> DefaultMii{ |
| 9 | Service::Mii::DefaultMii{ | 114 | Service::Mii::DefaultMii{ |
| 10 | .face_type = 0, | 115 | .face_type = 0, |
diff --git a/src/core/hle/service/mii/raw_data.h b/src/core/hle/service/mii/raw_data.h index 5b81b013b..cdd2337d6 100644 --- a/src/core/hle/service/mii/raw_data.h +++ b/src/core/hle/service/mii/raw_data.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | namespace Service::Mii::RawData { | 10 | namespace Service::Mii::RawData { |
| 11 | 11 | ||
| 12 | extern const std::array<Service::Mii::DefaultMii, 2> BaseMii; | ||
| 12 | extern const std::array<Service::Mii::DefaultMii, 6> DefaultMii; | 13 | extern const std::array<Service::Mii::DefaultMii, 6> DefaultMii; |
| 13 | extern const std::array<Service::Mii::RandomMiiData4, 18> RandomMiiFaceline; | 14 | extern const std::array<Service::Mii::RandomMiiData4, 18> RandomMiiFaceline; |
| 14 | extern const std::array<Service::Mii::RandomMiiData3, 6> RandomMiiFacelineColor; | 15 | extern const std::array<Service::Mii::RandomMiiData3, 6> RandomMiiFacelineColor; |
diff --git a/src/core/hle/service/nfc/common/device.cpp b/src/core/hle/service/nfc/common/device.cpp index 49446bc42..5df40f9a0 100644 --- a/src/core/hle/service/nfc/common/device.cpp +++ b/src/core/hle/service/nfc/common/device.cpp | |||
| @@ -826,7 +826,7 @@ Result NfcDevice::SetRegisterInfoPrivate(const NFP::RegisterInfoPrivate& registe | |||
| 826 | } | 826 | } |
| 827 | 827 | ||
| 828 | Service::Mii::MiiManager manager; | 828 | Service::Mii::MiiManager manager; |
| 829 | const auto mii = manager.BuildDefault(0); | 829 | const auto mii = manager.BuildBase(Mii::Gender::Male); |
| 830 | auto& settings = tag_data.settings; | 830 | auto& settings = tag_data.settings; |
| 831 | 831 | ||
| 832 | if (tag_data.settings.settings.amiibo_initialized == 0) { | 832 | if (tag_data.settings.settings.amiibo_initialized == 0) { |
| @@ -1467,7 +1467,7 @@ void NfcDevice::BuildAmiiboWithoutKeys(NFP::NTAG215File& stubbed_tag_data, | |||
| 1467 | SetAmiiboName(settings, {'y', 'u', 'z', 'u', 'A', 'm', 'i', 'i', 'b', 'o'}); | 1467 | SetAmiiboName(settings, {'y', 'u', 'z', 'u', 'A', 'm', 'i', 'i', 'b', 'o'}); |
| 1468 | settings.settings.font_region.Assign(0); | 1468 | settings.settings.font_region.Assign(0); |
| 1469 | settings.init_date = GetAmiiboDate(GetCurrentPosixTime()); | 1469 | settings.init_date = GetAmiiboDate(GetCurrentPosixTime()); |
| 1470 | stubbed_tag_data.owner_mii = manager.BuildFromStoreData(manager.BuildDefault(0)); | 1470 | stubbed_tag_data.owner_mii = manager.BuildFromStoreData(manager.BuildBase(Mii::Gender::Male)); |
| 1471 | 1471 | ||
| 1472 | // Admin info | 1472 | // Admin info |
| 1473 | settings.settings.amiibo_initialized.Assign(1); | 1473 | settings.settings.amiibo_initialized.Assign(1); |
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index 454bb66a4..c4c30d807 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp | |||
| @@ -66,21 +66,6 @@ std::string BuildCommaSeparatedExtensions( | |||
| 66 | return fmt::format("{}", fmt::join(available_extensions, ",")); | 66 | return fmt::format("{}", fmt::join(available_extensions, ",")); |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | DebugCallback MakeDebugCallback(const vk::Instance& instance, const vk::InstanceDispatch& dld) { | ||
| 70 | if (!Settings::values.renderer_debug) { | ||
| 71 | return DebugCallback{}; | ||
| 72 | } | ||
| 73 | const std::optional properties = vk::EnumerateInstanceExtensionProperties(dld); | ||
| 74 | const auto it = std::ranges::find_if(*properties, [](const auto& prop) { | ||
| 75 | return std::strcmp(VK_EXT_DEBUG_UTILS_EXTENSION_NAME, prop.extensionName) == 0; | ||
| 76 | }); | ||
| 77 | if (it != properties->end()) { | ||
| 78 | return CreateDebugUtilsCallback(instance); | ||
| 79 | } else { | ||
| 80 | return CreateDebugReportCallback(instance); | ||
| 81 | } | ||
| 82 | } | ||
| 83 | |||
| 84 | } // Anonymous namespace | 69 | } // Anonymous namespace |
| 85 | 70 | ||
| 86 | Device CreateDevice(const vk::Instance& instance, const vk::InstanceDispatch& dld, | 71 | Device CreateDevice(const vk::Instance& instance, const vk::InstanceDispatch& dld, |
| @@ -103,7 +88,8 @@ RendererVulkan::RendererVulkan(Core::TelemetrySession& telemetry_session_, | |||
| 103 | cpu_memory(cpu_memory_), gpu(gpu_), library(OpenLibrary(context.get())), | 88 | cpu_memory(cpu_memory_), gpu(gpu_), library(OpenLibrary(context.get())), |
| 104 | instance(CreateInstance(*library, dld, VK_API_VERSION_1_1, render_window.GetWindowInfo().type, | 89 | instance(CreateInstance(*library, dld, VK_API_VERSION_1_1, render_window.GetWindowInfo().type, |
| 105 | Settings::values.renderer_debug.GetValue())), | 90 | Settings::values.renderer_debug.GetValue())), |
| 106 | debug_callback(MakeDebugCallback(instance, dld)), | 91 | debug_messenger(Settings::values.renderer_debug ? CreateDebugUtilsCallback(instance) |
| 92 | : vk::DebugUtilsMessenger{}), | ||
| 107 | surface(CreateSurface(instance, render_window.GetWindowInfo())), | 93 | surface(CreateSurface(instance, render_window.GetWindowInfo())), |
| 108 | device(CreateDevice(instance, dld, *surface)), memory_allocator(device), state_tracker(), | 94 | device(CreateDevice(instance, dld, *surface)), memory_allocator(device), state_tracker(), |
| 109 | scheduler(device, state_tracker), | 95 | scheduler(device, state_tracker), |
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.h b/src/video_core/renderer_vulkan/renderer_vulkan.h index 89e98425e..590bc1c64 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.h +++ b/src/video_core/renderer_vulkan/renderer_vulkan.h | |||
| @@ -35,8 +35,6 @@ class GPU; | |||
| 35 | 35 | ||
| 36 | namespace Vulkan { | 36 | namespace Vulkan { |
| 37 | 37 | ||
| 38 | using DebugCallback = std::variant<vk::DebugUtilsMessenger, vk::DebugReportCallback>; | ||
| 39 | |||
| 40 | Device CreateDevice(const vk::Instance& instance, const vk::InstanceDispatch& dld, | 38 | Device CreateDevice(const vk::Instance& instance, const vk::InstanceDispatch& dld, |
| 41 | VkSurfaceKHR surface); | 39 | VkSurfaceKHR surface); |
| 42 | 40 | ||
| @@ -75,7 +73,7 @@ private: | |||
| 75 | vk::InstanceDispatch dld; | 73 | vk::InstanceDispatch dld; |
| 76 | 74 | ||
| 77 | vk::Instance instance; | 75 | vk::Instance instance; |
| 78 | DebugCallback debug_callback; | 76 | vk::DebugUtilsMessenger debug_messenger; |
| 79 | vk::SurfaceKHR surface; | 77 | vk::SurfaceKHR surface; |
| 80 | 78 | ||
| 81 | ScreenInfo screen_info; | 79 | ScreenInfo screen_info; |
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 60a6ac651..e15865d16 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp | |||
| @@ -529,17 +529,20 @@ void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bi | |||
| 529 | buffer_handles.push_back(handle); | 529 | buffer_handles.push_back(handle); |
| 530 | } | 530 | } |
| 531 | if (device.IsExtExtendedDynamicStateSupported()) { | 531 | if (device.IsExtExtendedDynamicStateSupported()) { |
| 532 | scheduler.Record([bindings_ = std::move(bindings), | 532 | scheduler.Record([this, bindings_ = std::move(bindings), |
| 533 | buffer_handles_ = std::move(buffer_handles)](vk::CommandBuffer cmdbuf) { | 533 | buffer_handles_ = std::move(buffer_handles)](vk::CommandBuffer cmdbuf) { |
| 534 | cmdbuf.BindVertexBuffers2EXT(bindings_.min_index, | 534 | cmdbuf.BindVertexBuffers2EXT(bindings_.min_index, |
| 535 | bindings_.max_index - bindings_.min_index, | 535 | std::min(bindings_.max_index - bindings_.min_index, |
| 536 | device.GetMaxVertexInputBindings()), | ||
| 536 | buffer_handles_.data(), bindings_.offsets.data(), | 537 | buffer_handles_.data(), bindings_.offsets.data(), |
| 537 | bindings_.sizes.data(), bindings_.strides.data()); | 538 | bindings_.sizes.data(), bindings_.strides.data()); |
| 538 | }); | 539 | }); |
| 539 | } else { | 540 | } else { |
| 540 | scheduler.Record([bindings_ = std::move(bindings), | 541 | scheduler.Record([this, bindings_ = std::move(bindings), |
| 541 | buffer_handles_ = std::move(buffer_handles)](vk::CommandBuffer cmdbuf) { | 542 | buffer_handles_ = std::move(buffer_handles)](vk::CommandBuffer cmdbuf) { |
| 542 | cmdbuf.BindVertexBuffers(bindings_.min_index, bindings_.max_index - bindings_.min_index, | 543 | cmdbuf.BindVertexBuffers(bindings_.min_index, |
| 544 | std::min(bindings_.max_index - bindings_.min_index, | ||
| 545 | device.GetMaxVertexInputBindings()), | ||
| 543 | buffer_handles_.data(), bindings_.offsets.data()); | 546 | buffer_handles_.data(), bindings_.offsets.data()); |
| 544 | }); | 547 | }); |
| 545 | } | 548 | } |
diff --git a/src/video_core/vulkan_common/vulkan_debug_callback.cpp b/src/video_core/vulkan_common/vulkan_debug_callback.cpp index 67e8065a4..448df2d3a 100644 --- a/src/video_core/vulkan_common/vulkan_debug_callback.cpp +++ b/src/video_core/vulkan_common/vulkan_debug_callback.cpp | |||
| @@ -63,22 +63,6 @@ VkBool32 DebugUtilCallback(VkDebugUtilsMessageSeverityFlagBitsEXT severity, | |||
| 63 | return VK_FALSE; | 63 | return VK_FALSE; |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | VkBool32 DebugReportCallback(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, | ||
| 67 | uint64_t object, size_t location, int32_t messageCode, | ||
| 68 | const char* pLayerPrefix, const char* pMessage, void* pUserData) { | ||
| 69 | const VkDebugReportFlagBitsEXT severity = static_cast<VkDebugReportFlagBitsEXT>(flags); | ||
| 70 | const std::string_view message{pMessage}; | ||
| 71 | if (severity & VK_DEBUG_REPORT_ERROR_BIT_EXT) { | ||
| 72 | LOG_CRITICAL(Render_Vulkan, "{}", message); | ||
| 73 | } else if (severity & VK_DEBUG_REPORT_WARNING_BIT_EXT) { | ||
| 74 | LOG_WARNING(Render_Vulkan, "{}", message); | ||
| 75 | } else if (severity & VK_DEBUG_REPORT_INFORMATION_BIT_EXT) { | ||
| 76 | LOG_INFO(Render_Vulkan, "{}", message); | ||
| 77 | } else if (severity & VK_DEBUG_REPORT_DEBUG_BIT_EXT) { | ||
| 78 | LOG_DEBUG(Render_Vulkan, "{}", message); | ||
| 79 | } | ||
| 80 | return VK_FALSE; | ||
| 81 | } | ||
| 82 | } // Anonymous namespace | 66 | } // Anonymous namespace |
| 83 | 67 | ||
| 84 | vk::DebugUtilsMessenger CreateDebugUtilsCallback(const vk::Instance& instance) { | 68 | vk::DebugUtilsMessenger CreateDebugUtilsCallback(const vk::Instance& instance) { |
| @@ -98,15 +82,4 @@ vk::DebugUtilsMessenger CreateDebugUtilsCallback(const vk::Instance& instance) { | |||
| 98 | }); | 82 | }); |
| 99 | } | 83 | } |
| 100 | 84 | ||
| 101 | vk::DebugReportCallback CreateDebugReportCallback(const vk::Instance& instance) { | ||
| 102 | return instance.CreateDebugReportCallback({ | ||
| 103 | .sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, | ||
| 104 | .pNext = nullptr, | ||
| 105 | .flags = VK_DEBUG_REPORT_DEBUG_BIT_EXT | VK_DEBUG_REPORT_INFORMATION_BIT_EXT | | ||
| 106 | VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT, | ||
| 107 | .pfnCallback = DebugReportCallback, | ||
| 108 | .pUserData = nullptr, | ||
| 109 | }); | ||
| 110 | } | ||
| 111 | |||
| 112 | } // namespace Vulkan | 85 | } // namespace Vulkan |
diff --git a/src/video_core/vulkan_common/vulkan_debug_callback.h b/src/video_core/vulkan_common/vulkan_debug_callback.h index a8af7b406..5e940782f 100644 --- a/src/video_core/vulkan_common/vulkan_debug_callback.h +++ b/src/video_core/vulkan_common/vulkan_debug_callback.h | |||
| @@ -9,6 +9,4 @@ namespace Vulkan { | |||
| 9 | 9 | ||
| 10 | vk::DebugUtilsMessenger CreateDebugUtilsCallback(const vk::Instance& instance); | 10 | vk::DebugUtilsMessenger CreateDebugUtilsCallback(const vk::Instance& instance); |
| 11 | 11 | ||
| 12 | vk::DebugReportCallback CreateDebugReportCallback(const vk::Instance& instance); | ||
| 13 | |||
| 14 | } // namespace Vulkan | 12 | } // namespace Vulkan |
diff --git a/src/video_core/vulkan_common/vulkan_instance.cpp b/src/video_core/vulkan_common/vulkan_instance.cpp index bc16145be..180657a75 100644 --- a/src/video_core/vulkan_common/vulkan_instance.cpp +++ b/src/video_core/vulkan_common/vulkan_instance.cpp | |||
| @@ -76,11 +76,9 @@ namespace { | |||
| 76 | extensions.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME); | 76 | extensions.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME); |
| 77 | } | 77 | } |
| 78 | #endif | 78 | #endif |
| 79 | if (enable_validation) { | 79 | if (enable_validation && |
| 80 | const bool debug_utils = | 80 | AreExtensionsSupported(dld, std::array{VK_EXT_DEBUG_UTILS_EXTENSION_NAME})) { |
| 81 | AreExtensionsSupported(dld, std::array{VK_EXT_DEBUG_UTILS_EXTENSION_NAME}); | 81 | extensions.push_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME); |
| 82 | extensions.push_back(debug_utils ? VK_EXT_DEBUG_UTILS_EXTENSION_NAME | ||
| 83 | : VK_EXT_DEBUG_REPORT_EXTENSION_NAME); | ||
| 84 | } | 82 | } |
| 85 | return extensions; | 83 | return extensions; |
| 86 | } | 84 | } |