diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | CMakeModules/FindRenderDoc.cmake | 19 | ||||
-rw-r--r-- | externals/CMakeLists.txt | 7 | ||||
-rw-r--r-- | src/audio_core/renderer/command/command_processing_time_estimator.cpp | 4 | ||||
-rw-r--r-- | src/audio_core/renderer/system.cpp | 10 | ||||
-rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/core/hle/service/aoc/aoc_u.cpp | 20 | ||||
-rw-r--r-- | src/core/tools/renderdoc.cpp | 2 | ||||
-rw-r--r-- | src/video_core/texture_cache/format_lookup_table.cpp | 2 |
9 files changed, 55 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b0891adf..2bef9d6ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -333,6 +333,7 @@ find_package(LLVM 17 MODULE COMPONENTS Demangle) find_package(lz4 REQUIRED) find_package(nlohmann_json 3.8 REQUIRED) find_package(Opus 1.3 MODULE) +find_package(RenderDoc MODULE) find_package(VulkanMemoryAllocator CONFIG) find_package(ZLIB 1.2 REQUIRED) find_package(zstd 1.5 REQUIRED) diff --git a/CMakeModules/FindRenderDoc.cmake b/CMakeModules/FindRenderDoc.cmake new file mode 100644 index 000000000..2678b936b --- /dev/null +++ b/CMakeModules/FindRenderDoc.cmake @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2023 Alexandre Bouvier <contact@amb.tf> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +find_path(RenderDoc_INCLUDE_DIR renderdoc_app.h) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(RenderDoc + REQUIRED_VARS RenderDoc_INCLUDE_DIR +) + +if (RenderDoc_FOUND AND NOT TARGET RenderDoc::API) + add_library(RenderDoc::API INTERFACE IMPORTED) + set_target_properties(RenderDoc::API PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${RenderDoc_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced(RenderDoc_INCLUDE_DIR) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index a4c2ffc10..9eebc7d65 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -174,8 +174,11 @@ target_include_directories(stb PUBLIC ./stb) add_library(bc_decoder bc_decoder/bc_decoder.cpp) target_include_directories(bc_decoder PUBLIC ./bc_decoder) -add_library(renderdoc INTERFACE) -target_include_directories(renderdoc SYSTEM INTERFACE ./renderdoc) +if (NOT TARGET RenderDoc::API) + add_library(renderdoc INTERFACE) + target_include_directories(renderdoc SYSTEM INTERFACE ./renderdoc) + add_library(RenderDoc::API ALIAS renderdoc) +endif() if (ANDROID) if (ARCHITECTURE_arm64) diff --git a/src/audio_core/renderer/command/command_processing_time_estimator.cpp b/src/audio_core/renderer/command/command_processing_time_estimator.cpp index a48a016b1..0f7aff1b4 100644 --- a/src/audio_core/renderer/command/command_processing_time_estimator.cpp +++ b/src/audio_core/renderer/command/command_processing_time_estimator.cpp @@ -27,12 +27,12 @@ u32 CommandProcessingTimeEstimatorVersion1::Estimate( u32 CommandProcessingTimeEstimatorVersion1::Estimate( const AdpcmDataSourceVersion1Command& command) const { - return static_cast<u32>(command.pitch * 0.25f * 1.2f); + return static_cast<u32>(command.pitch * 0.46f * 1.2f); } u32 CommandProcessingTimeEstimatorVersion1::Estimate( const AdpcmDataSourceVersion2Command& command) const { - return static_cast<u32>(command.pitch * 0.25f * 1.2f); + return static_cast<u32>(command.pitch * 0.46f * 1.2f); } u32 CommandProcessingTimeEstimatorVersion1::Estimate( diff --git a/src/audio_core/renderer/system.cpp b/src/audio_core/renderer/system.cpp index d29754634..31f92087c 100644 --- a/src/audio_core/renderer/system.cpp +++ b/src/audio_core/renderer/system.cpp @@ -684,11 +684,11 @@ u64 System::GenerateCommand(std::span<u8> in_command_buffer, sink_context, splitter_context, perf_manager}; voice_context.SortInfo(); + command_generator.GenerateVoiceCommands(); const auto start_estimated_time{drop_voice_param * static_cast<f32>(command_buffer.estimated_process_time)}; - command_generator.GenerateVoiceCommands(); command_generator.GenerateSubMixCommands(); command_generator.GenerateFinalMixCommands(); command_generator.GenerateSinkCommands(); @@ -708,11 +708,13 @@ u64 System::GenerateCommand(std::span<u8> in_command_buffer, const auto end_estimated_time{drop_voice_param * static_cast<f32>(command_buffer.estimated_process_time)}; + + const auto dsp_time_limit{((time_limit_percent / 100.0f) * 2'880'000.0f) * + (static_cast<f32>(render_time_limit_percent) / 100.0f)}; + const auto estimated_time{start_estimated_time - end_estimated_time}; - const auto time_limit{static_cast<u32>( - estimated_time + (((time_limit_percent / 100.0f) * 2'880'000.0) * - (static_cast<f32>(render_time_limit_percent) / 100.0f)))}; + const auto time_limit{static_cast<u32>(std::max(dsp_time_limit + estimated_time, 0.0f))}; num_voices_dropped = DropVoices(command_buffer, static_cast<u32>(start_estimated_time), time_limit); } diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 46e2dc839..d0f76e57e 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -894,7 +894,7 @@ endif() create_target_directory_groups(core) target_link_libraries(core PUBLIC common PRIVATE audio_core network video_core nx_tzdb) -target_link_libraries(core PUBLIC Boost::headers PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls renderdoc) +target_link_libraries(core PUBLIC Boost::headers PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls RenderDoc::API) if (MINGW) target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY}) endif() diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp index 38c2138e8..7075ab800 100644 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/aoc_u.cpp @@ -22,6 +22,8 @@ namespace Service::AOC { +constexpr Result ResultNoPurchasedProductInfoAvailable{ErrorModule::NIMShop, 400}; + static bool CheckAOCTitleIDMatchesBase(u64 title_id, u64 base) { return FileSys::GetBaseTitleID(title_id) == base; } @@ -54,8 +56,8 @@ public: {0, &IPurchaseEventManager::SetDefaultDeliveryTarget, "SetDefaultDeliveryTarget"}, {1, &IPurchaseEventManager::SetDeliveryTarget, "SetDeliveryTarget"}, {2, &IPurchaseEventManager::GetPurchasedEventReadableHandle, "GetPurchasedEventReadableHandle"}, - {3, nullptr, "PopPurchasedProductInfo"}, - {4, nullptr, "PopPurchasedProductInfoWithUid"}, + {3, &IPurchaseEventManager::PopPurchasedProductInfo, "PopPurchasedProductInfo"}, + {4, &IPurchaseEventManager::PopPurchasedProductInfoWithUid, "PopPurchasedProductInfoWithUid"}, }; // clang-format on @@ -101,6 +103,20 @@ private: rb.PushCopyObjects(purchased_event->GetReadableEvent()); } + void PopPurchasedProductInfo(HLERequestContext& ctx) { + LOG_DEBUG(Service_AOC, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultNoPurchasedProductInfoAvailable); + } + + void PopPurchasedProductInfoWithUid(HLERequestContext& ctx) { + LOG_DEBUG(Service_AOC, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultNoPurchasedProductInfoAvailable); + } + KernelHelpers::ServiceContext service_context; Kernel::KEvent* purchased_event; diff --git a/src/core/tools/renderdoc.cpp b/src/core/tools/renderdoc.cpp index 44d24822a..947fa6cb3 100644 --- a/src/core/tools/renderdoc.cpp +++ b/src/core/tools/renderdoc.cpp @@ -7,7 +7,7 @@ #include "common/dynamic_library.h" #include "core/tools/renderdoc.h" -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #else #include <dlfcn.h> diff --git a/src/video_core/texture_cache/format_lookup_table.cpp b/src/video_core/texture_cache/format_lookup_table.cpp index 11ced6c38..56307d030 100644 --- a/src/video_core/texture_cache/format_lookup_table.cpp +++ b/src/video_core/texture_cache/format_lookup_table.cpp @@ -140,6 +140,8 @@ PixelFormat PixelFormatFromTextureInfo(TextureFormat format, ComponentType red, return PixelFormat::D32_FLOAT; case Hash(TextureFormat::Z16, UNORM): return PixelFormat::D16_UNORM; + case Hash(TextureFormat::Z16, UNORM, UINT, UINT, UINT, LINEAR): + return PixelFormat::D16_UNORM; case Hash(TextureFormat::Z24S8, UINT, UNORM, UNORM, UNORM, LINEAR): return PixelFormat::S8_UINT_D24_UNORM; case Hash(TextureFormat::Z24S8, UINT, UNORM, UINT, UINT, LINEAR): |