diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/core/constants.h | 1 | ||||
-rw-r--r-- | src/core/hle/kernel/address_arbiter.cpp | 1 | ||||
-rw-r--r-- | src/core/hle/kernel/svc.cpp | 7 | ||||
-rw-r--r-- | src/core/hle/kernel/synchronization.cpp | 1 | ||||
-rw-r--r-- | src/core/hle/kernel/thread.h | 2 | ||||
-rw-r--r-- | src/core/settings.cpp | 77 | ||||
-rw-r--r-- | src/video_core/macro/macro.h | 3 | ||||
-rw-r--r-- | src/video_core/macro/macro_hle.cpp | 3 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 10 | ||||
-rw-r--r-- | src/video_core/shader_cache.h | 4 |
11 files changed, 52 insertions, 58 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index ff941d505..c42f95705 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -185,6 +185,7 @@ add_library(core STATIC hle/kernel/object.h hle/kernel/physical_core.cpp hle/kernel/physical_core.h + hle/kernel/physical_memory.h hle/kernel/process.cpp hle/kernel/process.h hle/kernel/process_capability.cpp diff --git a/src/core/constants.h b/src/core/constants.h index 6d0ec022a..81c5cb279 100644 --- a/src/core/constants.h +++ b/src/core/constants.h @@ -4,6 +4,7 @@ #pragma once +#include <array> #include "common/common_types.h" // This is to consolidate system-wide constants that are used by multiple components of yuzu. diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index 4d2a9b35d..df0debe1b 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp @@ -24,7 +24,6 @@ namespace Kernel { // Wake up num_to_wake (or all) threads in a vector. void AddressArbiter::WakeThreads(const std::vector<std::shared_ptr<Thread>>& waiting_threads, s32 num_to_wake) { - auto& time_manager = system.Kernel().TimeManager(); // Only process up to 'target' threads, unless 'target' is <= 0, in which case process // them all. std::size_t last = waiting_threads.size(); diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 5db19dcf3..01ae57053 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -458,9 +458,7 @@ static ResultCode WaitSynchronization(Core::System& system, Handle* index, VAddr return ERR_OUT_OF_RANGE; } - auto* const thread = system.CurrentScheduler().GetCurrentThread(); auto& kernel = system.Kernel(); - using ObjectPtr = Thread::ThreadSynchronizationObjects::value_type; Thread::ThreadSynchronizationObjects objects(handle_count); const auto& handle_table = kernel.CurrentProcess()->GetHandleTable(); @@ -1750,9 +1748,9 @@ static void SignalProcessWideKey(Core::System& system, VAddr condition_variable_ // Only process up to 'target' threads, unless 'target' is less equal 0, in which case process // them all. std::size_t last = waiting_threads.size(); - if (target > 0) + if (target > 0) { last = std::min(waiting_threads.size(), static_cast<std::size_t>(target)); - auto& time_manager = kernel.TimeManager(); + } for (std::size_t index = 0; index < last; ++index) { auto& thread = waiting_threads[index]; @@ -1763,7 +1761,6 @@ static void SignalProcessWideKey(Core::System& system, VAddr condition_variable_ const std::size_t current_core = system.CurrentCoreIndex(); auto& monitor = system.Monitor(); - auto& memory = system.Memory(); // Atomically read the value of the mutex. u32 mutex_val = 0; diff --git a/src/core/hle/kernel/synchronization.cpp b/src/core/hle/kernel/synchronization.cpp index 851b702a5..8b875d853 100644 --- a/src/core/hle/kernel/synchronization.cpp +++ b/src/core/hle/kernel/synchronization.cpp @@ -19,7 +19,6 @@ Synchronization::Synchronization(Core::System& system) : system{system} {} void Synchronization::SignalObject(SynchronizationObject& obj) const { auto& kernel = system.Kernel(); SchedulerLock lock(kernel); - auto& time_manager = kernel.TimeManager(); if (obj.IsSignaled()) { for (auto thread : obj.GetWaitingThreads()) { if (thread->GetSchedulingStatus() == ThreadSchedStatus::Paused) { diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 9808767e5..8daf79fac 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h @@ -583,8 +583,6 @@ private: void SetCurrentPriority(u32 new_priority); - void AdjustSchedulingOnAffinity(u64 old_affinity_mask, s32 old_core); - Common::SpinLock context_guard{}; ThreadContext32 context_32{}; ThreadContext64 context_64{}; diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 64a3c69d3..e8a6f2a6e 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <string_view> + #include "common/file_util.h" #include "core/core.h" #include "core/gdbstub/gdbstub.h" @@ -65,18 +67,18 @@ Values values = {}; bool configuring_global = true; std::string GetTimeZoneString() { - static constexpr std::array<const char*, 46> timezones{{ + static constexpr std::array timezones{ "auto", "default", "CET", "CST6CDT", "Cuba", "EET", "Egypt", "Eire", "EST", "EST5EDT", "GB", "GB-Eire", "GMT", "GMT+0", "GMT-0", "GMT0", "Greenwich", "Hongkong", "HST", "Iceland", "Iran", "Israel", "Jamaica", "Japan", "Kwajalein", "Libya", "MET", "MST", "MST7MDT", "Navajo", "NZ", "NZ-CHAT", "Poland", "Portugal", "PRC", "PST8PDT", "ROC", "ROK", "Singapore", "Turkey", "UCT", "Universal", "UTC", "W-SU", "WET", "Zulu", - }}; - - ASSERT(Settings::values.time_zone_index.GetValue() < timezones.size()); + }; - return timezones[Settings::values.time_zone_index.GetValue()]; + const auto time_zone_index = static_cast<std::size_t>(values.time_zone_index.GetValue()); + ASSERT(time_zone_index < timezones.size()); + return timezones[time_zone_index]; } void Apply() { @@ -91,41 +93,40 @@ void Apply() { Service::HID::ReloadInputDevices(); } -template <typename T> -void LogSetting(const std::string& name, const T& value) { - LOG_INFO(Config, "{}: {}", name, value); -} - void LogSettings() { + const auto log_setting = [](std::string_view name, const auto& value) { + LOG_INFO(Config, "{}: {}", name, value); + }; + LOG_INFO(Config, "yuzu Configuration:"); - LogSetting("Controls_UseDockedMode", Settings::values.use_docked_mode); - LogSetting("System_RngSeed", Settings::values.rng_seed.GetValue().value_or(0)); - LogSetting("System_CurrentUser", Settings::values.current_user); - LogSetting("System_LanguageIndex", Settings::values.language_index.GetValue()); - LogSetting("System_RegionIndex", Settings::values.region_index.GetValue()); - LogSetting("System_TimeZoneIndex", Settings::values.time_zone_index.GetValue()); - LogSetting("Core_UseMultiCore", Settings::values.use_multi_core.GetValue()); - LogSetting("Renderer_UseResolutionFactor", Settings::values.resolution_factor.GetValue()); - LogSetting("Renderer_UseFrameLimit", Settings::values.use_frame_limit.GetValue()); - LogSetting("Renderer_FrameLimit", Settings::values.frame_limit.GetValue()); - LogSetting("Renderer_UseDiskShaderCache", Settings::values.use_disk_shader_cache.GetValue()); - LogSetting("Renderer_GPUAccuracyLevel", Settings::values.gpu_accuracy.GetValue()); - LogSetting("Renderer_UseAsynchronousGpuEmulation", - Settings::values.use_asynchronous_gpu_emulation.GetValue()); - LogSetting("Renderer_UseVsync", Settings::values.use_vsync.GetValue()); - LogSetting("Renderer_UseAssemblyShaders", Settings::values.use_assembly_shaders.GetValue()); - LogSetting("Renderer_AnisotropicFilteringLevel", Settings::values.max_anisotropy.GetValue()); - LogSetting("Audio_OutputEngine", Settings::values.sink_id); - LogSetting("Audio_EnableAudioStretching", Settings::values.enable_audio_stretching.GetValue()); - LogSetting("Audio_OutputDevice", Settings::values.audio_device_id); - LogSetting("DataStorage_UseVirtualSd", Settings::values.use_virtual_sd); - LogSetting("DataStorage_NandDir", FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)); - LogSetting("DataStorage_SdmcDir", FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir)); - LogSetting("Debugging_UseGdbstub", Settings::values.use_gdbstub); - LogSetting("Debugging_GdbstubPort", Settings::values.gdbstub_port); - LogSetting("Debugging_ProgramArgs", Settings::values.program_args); - LogSetting("Services_BCATBackend", Settings::values.bcat_backend); - LogSetting("Services_BCATBoxcatLocal", Settings::values.bcat_boxcat_local); + log_setting("Controls_UseDockedMode", values.use_docked_mode); + log_setting("System_RngSeed", values.rng_seed.GetValue().value_or(0)); + log_setting("System_CurrentUser", values.current_user); + log_setting("System_LanguageIndex", values.language_index.GetValue()); + log_setting("System_RegionIndex", values.region_index.GetValue()); + log_setting("System_TimeZoneIndex", values.time_zone_index.GetValue()); + log_setting("Core_UseMultiCore", values.use_multi_core.GetValue()); + log_setting("Renderer_UseResolutionFactor", values.resolution_factor.GetValue()); + log_setting("Renderer_UseFrameLimit", values.use_frame_limit.GetValue()); + log_setting("Renderer_FrameLimit", values.frame_limit.GetValue()); + log_setting("Renderer_UseDiskShaderCache", values.use_disk_shader_cache.GetValue()); + log_setting("Renderer_GPUAccuracyLevel", values.gpu_accuracy.GetValue()); + log_setting("Renderer_UseAsynchronousGpuEmulation", + values.use_asynchronous_gpu_emulation.GetValue()); + log_setting("Renderer_UseVsync", values.use_vsync.GetValue()); + log_setting("Renderer_UseAssemblyShaders", values.use_assembly_shaders.GetValue()); + log_setting("Renderer_AnisotropicFilteringLevel", values.max_anisotropy.GetValue()); + log_setting("Audio_OutputEngine", values.sink_id); + log_setting("Audio_EnableAudioStretching", values.enable_audio_stretching.GetValue()); + log_setting("Audio_OutputDevice", values.audio_device_id); + log_setting("DataStorage_UseVirtualSd", values.use_virtual_sd); + log_setting("DataStorage_NandDir", FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)); + log_setting("DataStorage_SdmcDir", FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir)); + log_setting("Debugging_UseGdbstub", values.use_gdbstub); + log_setting("Debugging_GdbstubPort", values.gdbstub_port); + log_setting("Debugging_ProgramArgs", values.program_args); + log_setting("Services_BCATBackend", values.bcat_backend); + log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local); } float Volume() { diff --git a/src/video_core/macro/macro.h b/src/video_core/macro/macro.h index 4d00b84b0..31ee3440a 100644 --- a/src/video_core/macro/macro.h +++ b/src/video_core/macro/macro.h @@ -103,8 +103,9 @@ public: virtual ~CachedMacro() = default; /** * Executes the macro code with the specified input parameters. - * @param code The macro byte code to execute + * * @param parameters The parameters of the macro + * @param method The method to execute */ virtual void Execute(const std::vector<u32>& parameters, u32 method) = 0; }; diff --git a/src/video_core/macro/macro_hle.cpp b/src/video_core/macro/macro_hle.cpp index 768ae9139..0c9ff59a4 100644 --- a/src/video_core/macro/macro_hle.cpp +++ b/src/video_core/macro/macro_hle.cpp @@ -16,8 +16,7 @@ void HLE_771BB18C62444DA0(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& const u32 instance_count = parameters[2] & maxwell3d.GetRegisterValue(0xD1B); maxwell3d.regs.draw.topology.Assign( - static_cast<Tegra::Engines::Maxwell3D::Regs::PrimitiveTopology>(parameters[0] & - ~(0x3ffffff << 26))); + static_cast<Tegra::Engines::Maxwell3D::Regs::PrimitiveTopology>(parameters[0] & 0x3ffffff)); maxwell3d.regs.vb_base_instance = parameters[5]; maxwell3d.mme_draw.instance_count = instance_count; maxwell3d.regs.vb_element_base = parameters[3]; diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 430031665..bd93dcf20 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -281,12 +281,10 @@ void CachedSurface::UploadBuffer(const std::vector<u8>& staging_buffer) { VkBufferMemoryBarrier barrier; barrier.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER; barrier.pNext = nullptr; - barrier.srcAccessMask = VK_PIPELINE_STAGE_TRANSFER_BIT; - barrier.dstAccessMask = VK_PIPELINE_STAGE_VERTEX_SHADER_BIT; - barrier.srcQueueFamilyIndex = VK_ACCESS_TRANSFER_WRITE_BIT; - barrier.dstQueueFamilyIndex = VK_ACCESS_SHADER_READ_BIT; - barrier.srcQueueFamilyIndex = 0; - barrier.dstQueueFamilyIndex = 0; + barrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; + barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT; + barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; // They'll be ignored anyway + barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; barrier.buffer = dst_buffer; barrier.offset = 0; barrier.size = size; diff --git a/src/video_core/shader_cache.h b/src/video_core/shader_cache.h index b7608fc7b..015a789d6 100644 --- a/src/video_core/shader_cache.h +++ b/src/video_core/shader_cache.h @@ -209,11 +209,11 @@ private: } // Remove them from the cache - const auto is_removed = [&removed_shaders](std::unique_ptr<T>& shader) { + const auto is_removed = [&removed_shaders](const std::unique_ptr<T>& shader) { return std::find(removed_shaders.begin(), removed_shaders.end(), shader.get()) != removed_shaders.end(); }; - storage.erase(std::remove_if(storage.begin(), storage.end(), is_removed), storage.end()); + std::erase_if(storage, is_removed); } /// @brief Creates a new entry in the lookup cache and returns its pointer |