summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/CMakeLists.txt1
-rw-r--r--src/core/constants.h1
-rw-r--r--src/core/hle/kernel/address_arbiter.cpp1
-rw-r--r--src/core/hle/kernel/svc.cpp7
-rw-r--r--src/core/hle/kernel/synchronization.cpp1
-rw-r--r--src/core/hle/kernel/thread.h2
-rw-r--r--src/core/settings.cpp77
-rw-r--r--src/video_core/macro/macro.h3
-rw-r--r--src/video_core/macro/macro_hle.cpp3
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp10
-rw-r--r--src/video_core/shader_cache.h4
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
185 hle/kernel/object.h 185 hle/kernel/object.h
186 hle/kernel/physical_core.cpp 186 hle/kernel/physical_core.cpp
187 hle/kernel/physical_core.h 187 hle/kernel/physical_core.h
188 hle/kernel/physical_memory.h
188 hle/kernel/process.cpp 189 hle/kernel/process.cpp
189 hle/kernel/process.h 190 hle/kernel/process.h
190 hle/kernel/process_capability.cpp 191 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 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <array>
7#include "common/common_types.h" 8#include "common/common_types.h"
8 9
9// This is to consolidate system-wide constants that are used by multiple components of yuzu. 10// 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 {
24// Wake up num_to_wake (or all) threads in a vector. 24// Wake up num_to_wake (or all) threads in a vector.
25void AddressArbiter::WakeThreads(const std::vector<std::shared_ptr<Thread>>& waiting_threads, 25void AddressArbiter::WakeThreads(const std::vector<std::shared_ptr<Thread>>& waiting_threads,
26 s32 num_to_wake) { 26 s32 num_to_wake) {
27 auto& time_manager = system.Kernel().TimeManager();
28 // Only process up to 'target' threads, unless 'target' is <= 0, in which case process 27 // Only process up to 'target' threads, unless 'target' is <= 0, in which case process
29 // them all. 28 // them all.
30 std::size_t last = waiting_threads.size(); 29 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
458 return ERR_OUT_OF_RANGE; 458 return ERR_OUT_OF_RANGE;
459 } 459 }
460 460
461 auto* const thread = system.CurrentScheduler().GetCurrentThread();
462 auto& kernel = system.Kernel(); 461 auto& kernel = system.Kernel();
463 using ObjectPtr = Thread::ThreadSynchronizationObjects::value_type;
464 Thread::ThreadSynchronizationObjects objects(handle_count); 462 Thread::ThreadSynchronizationObjects objects(handle_count);
465 const auto& handle_table = kernel.CurrentProcess()->GetHandleTable(); 463 const auto& handle_table = kernel.CurrentProcess()->GetHandleTable();
466 464
@@ -1750,9 +1748,9 @@ static void SignalProcessWideKey(Core::System& system, VAddr condition_variable_
1750 // Only process up to 'target' threads, unless 'target' is less equal 0, in which case process 1748 // Only process up to 'target' threads, unless 'target' is less equal 0, in which case process
1751 // them all. 1749 // them all.
1752 std::size_t last = waiting_threads.size(); 1750 std::size_t last = waiting_threads.size();
1753 if (target > 0) 1751 if (target > 0) {
1754 last = std::min(waiting_threads.size(), static_cast<std::size_t>(target)); 1752 last = std::min(waiting_threads.size(), static_cast<std::size_t>(target));
1755 auto& time_manager = kernel.TimeManager(); 1753 }
1756 for (std::size_t index = 0; index < last; ++index) { 1754 for (std::size_t index = 0; index < last; ++index) {
1757 auto& thread = waiting_threads[index]; 1755 auto& thread = waiting_threads[index];
1758 1756
@@ -1763,7 +1761,6 @@ static void SignalProcessWideKey(Core::System& system, VAddr condition_variable_
1763 1761
1764 const std::size_t current_core = system.CurrentCoreIndex(); 1762 const std::size_t current_core = system.CurrentCoreIndex();
1765 auto& monitor = system.Monitor(); 1763 auto& monitor = system.Monitor();
1766 auto& memory = system.Memory();
1767 1764
1768 // Atomically read the value of the mutex. 1765 // Atomically read the value of the mutex.
1769 u32 mutex_val = 0; 1766 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} {}
19void Synchronization::SignalObject(SynchronizationObject& obj) const { 19void Synchronization::SignalObject(SynchronizationObject& obj) const {
20 auto& kernel = system.Kernel(); 20 auto& kernel = system.Kernel();
21 SchedulerLock lock(kernel); 21 SchedulerLock lock(kernel);
22 auto& time_manager = kernel.TimeManager();
23 if (obj.IsSignaled()) { 22 if (obj.IsSignaled()) {
24 for (auto thread : obj.GetWaitingThreads()) { 23 for (auto thread : obj.GetWaitingThreads()) {
25 if (thread->GetSchedulingStatus() == ThreadSchedStatus::Paused) { 24 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:
583 583
584 void SetCurrentPriority(u32 new_priority); 584 void SetCurrentPriority(u32 new_priority);
585 585
586 void AdjustSchedulingOnAffinity(u64 old_affinity_mask, s32 old_core);
587
588 Common::SpinLock context_guard{}; 586 Common::SpinLock context_guard{};
589 ThreadContext32 context_32{}; 587 ThreadContext32 context_32{};
590 ThreadContext64 context_64{}; 588 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 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <string_view>
6
5#include "common/file_util.h" 7#include "common/file_util.h"
6#include "core/core.h" 8#include "core/core.h"
7#include "core/gdbstub/gdbstub.h" 9#include "core/gdbstub/gdbstub.h"
@@ -65,18 +67,18 @@ Values values = {};
65bool configuring_global = true; 67bool configuring_global = true;
66 68
67std::string GetTimeZoneString() { 69std::string GetTimeZoneString() {
68 static constexpr std::array<const char*, 46> timezones{{ 70 static constexpr std::array timezones{
69 "auto", "default", "CET", "CST6CDT", "Cuba", "EET", "Egypt", "Eire", 71 "auto", "default", "CET", "CST6CDT", "Cuba", "EET", "Egypt", "Eire",
70 "EST", "EST5EDT", "GB", "GB-Eire", "GMT", "GMT+0", "GMT-0", "GMT0", 72 "EST", "EST5EDT", "GB", "GB-Eire", "GMT", "GMT+0", "GMT-0", "GMT0",
71 "Greenwich", "Hongkong", "HST", "Iceland", "Iran", "Israel", "Jamaica", "Japan", 73 "Greenwich", "Hongkong", "HST", "Iceland", "Iran", "Israel", "Jamaica", "Japan",
72 "Kwajalein", "Libya", "MET", "MST", "MST7MDT", "Navajo", "NZ", "NZ-CHAT", 74 "Kwajalein", "Libya", "MET", "MST", "MST7MDT", "Navajo", "NZ", "NZ-CHAT",
73 "Poland", "Portugal", "PRC", "PST8PDT", "ROC", "ROK", "Singapore", "Turkey", 75 "Poland", "Portugal", "PRC", "PST8PDT", "ROC", "ROK", "Singapore", "Turkey",
74 "UCT", "Universal", "UTC", "W-SU", "WET", "Zulu", 76 "UCT", "Universal", "UTC", "W-SU", "WET", "Zulu",
75 }}; 77 };
76
77 ASSERT(Settings::values.time_zone_index.GetValue() < timezones.size());
78 78
79 return timezones[Settings::values.time_zone_index.GetValue()]; 79 const auto time_zone_index = static_cast<std::size_t>(values.time_zone_index.GetValue());
80 ASSERT(time_zone_index < timezones.size());
81 return timezones[time_zone_index];
80} 82}
81 83
82void Apply() { 84void Apply() {
@@ -91,41 +93,40 @@ void Apply() {
91 Service::HID::ReloadInputDevices(); 93 Service::HID::ReloadInputDevices();
92} 94}
93 95
94template <typename T>
95void LogSetting(const std::string& name, const T& value) {
96 LOG_INFO(Config, "{}: {}", name, value);
97}
98
99void LogSettings() { 96void LogSettings() {
97 const auto log_setting = [](std::string_view name, const auto& value) {
98 LOG_INFO(Config, "{}: {}", name, value);
99 };
100
100 LOG_INFO(Config, "yuzu Configuration:"); 101 LOG_INFO(Config, "yuzu Configuration:");
101 LogSetting("Controls_UseDockedMode", Settings::values.use_docked_mode); 102 log_setting("Controls_UseDockedMode", values.use_docked_mode);
102 LogSetting("System_RngSeed", Settings::values.rng_seed.GetValue().value_or(0)); 103 log_setting("System_RngSeed", values.rng_seed.GetValue().value_or(0));
103 LogSetting("System_CurrentUser", Settings::values.current_user); 104 log_setting("System_CurrentUser", values.current_user);
104 LogSetting("System_LanguageIndex", Settings::values.language_index.GetValue()); 105 log_setting("System_LanguageIndex", values.language_index.GetValue());
105 LogSetting("System_RegionIndex", Settings::values.region_index.GetValue()); 106 log_setting("System_RegionIndex", values.region_index.GetValue());
106 LogSetting("System_TimeZoneIndex", Settings::values.time_zone_index.GetValue()); 107 log_setting("System_TimeZoneIndex", values.time_zone_index.GetValue());
107 LogSetting("Core_UseMultiCore", Settings::values.use_multi_core.GetValue()); 108 log_setting("Core_UseMultiCore", values.use_multi_core.GetValue());
108 LogSetting("Renderer_UseResolutionFactor", Settings::values.resolution_factor.GetValue()); 109 log_setting("Renderer_UseResolutionFactor", values.resolution_factor.GetValue());
109 LogSetting("Renderer_UseFrameLimit", Settings::values.use_frame_limit.GetValue()); 110 log_setting("Renderer_UseFrameLimit", values.use_frame_limit.GetValue());
110 LogSetting("Renderer_FrameLimit", Settings::values.frame_limit.GetValue()); 111 log_setting("Renderer_FrameLimit", values.frame_limit.GetValue());
111 LogSetting("Renderer_UseDiskShaderCache", Settings::values.use_disk_shader_cache.GetValue()); 112 log_setting("Renderer_UseDiskShaderCache", values.use_disk_shader_cache.GetValue());
112 LogSetting("Renderer_GPUAccuracyLevel", Settings::values.gpu_accuracy.GetValue()); 113 log_setting("Renderer_GPUAccuracyLevel", values.gpu_accuracy.GetValue());
113 LogSetting("Renderer_UseAsynchronousGpuEmulation", 114 log_setting("Renderer_UseAsynchronousGpuEmulation",
114 Settings::values.use_asynchronous_gpu_emulation.GetValue()); 115 values.use_asynchronous_gpu_emulation.GetValue());
115 LogSetting("Renderer_UseVsync", Settings::values.use_vsync.GetValue()); 116 log_setting("Renderer_UseVsync", values.use_vsync.GetValue());
116 LogSetting("Renderer_UseAssemblyShaders", Settings::values.use_assembly_shaders.GetValue()); 117 log_setting("Renderer_UseAssemblyShaders", values.use_assembly_shaders.GetValue());
117 LogSetting("Renderer_AnisotropicFilteringLevel", Settings::values.max_anisotropy.GetValue()); 118 log_setting("Renderer_AnisotropicFilteringLevel", values.max_anisotropy.GetValue());
118 LogSetting("Audio_OutputEngine", Settings::values.sink_id); 119 log_setting("Audio_OutputEngine", values.sink_id);
119 LogSetting("Audio_EnableAudioStretching", Settings::values.enable_audio_stretching.GetValue()); 120 log_setting("Audio_EnableAudioStretching", values.enable_audio_stretching.GetValue());
120 LogSetting("Audio_OutputDevice", Settings::values.audio_device_id); 121 log_setting("Audio_OutputDevice", values.audio_device_id);
121 LogSetting("DataStorage_UseVirtualSd", Settings::values.use_virtual_sd); 122 log_setting("DataStorage_UseVirtualSd", values.use_virtual_sd);
122 LogSetting("DataStorage_NandDir", FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)); 123 log_setting("DataStorage_NandDir", FileUtil::GetUserPath(FileUtil::UserPath::NANDDir));
123 LogSetting("DataStorage_SdmcDir", FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir)); 124 log_setting("DataStorage_SdmcDir", FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir));
124 LogSetting("Debugging_UseGdbstub", Settings::values.use_gdbstub); 125 log_setting("Debugging_UseGdbstub", values.use_gdbstub);
125 LogSetting("Debugging_GdbstubPort", Settings::values.gdbstub_port); 126 log_setting("Debugging_GdbstubPort", values.gdbstub_port);
126 LogSetting("Debugging_ProgramArgs", Settings::values.program_args); 127 log_setting("Debugging_ProgramArgs", values.program_args);
127 LogSetting("Services_BCATBackend", Settings::values.bcat_backend); 128 log_setting("Services_BCATBackend", values.bcat_backend);
128 LogSetting("Services_BCATBoxcatLocal", Settings::values.bcat_boxcat_local); 129 log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local);
129} 130}
130 131
131float Volume() { 132float 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:
103 virtual ~CachedMacro() = default; 103 virtual ~CachedMacro() = default;
104 /** 104 /**
105 * Executes the macro code with the specified input parameters. 105 * Executes the macro code with the specified input parameters.
106 * @param code The macro byte code to execute 106 *
107 * @param parameters The parameters of the macro 107 * @param parameters The parameters of the macro
108 * @param method The method to execute
108 */ 109 */
109 virtual void Execute(const std::vector<u32>& parameters, u32 method) = 0; 110 virtual void Execute(const std::vector<u32>& parameters, u32 method) = 0;
110}; 111};
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>&
16 const u32 instance_count = parameters[2] & maxwell3d.GetRegisterValue(0xD1B); 16 const u32 instance_count = parameters[2] & maxwell3d.GetRegisterValue(0xD1B);
17 17
18 maxwell3d.regs.draw.topology.Assign( 18 maxwell3d.regs.draw.topology.Assign(
19 static_cast<Tegra::Engines::Maxwell3D::Regs::PrimitiveTopology>(parameters[0] & 19 static_cast<Tegra::Engines::Maxwell3D::Regs::PrimitiveTopology>(parameters[0] & 0x3ffffff));
20 ~(0x3ffffff << 26)));
21 maxwell3d.regs.vb_base_instance = parameters[5]; 20 maxwell3d.regs.vb_base_instance = parameters[5];
22 maxwell3d.mme_draw.instance_count = instance_count; 21 maxwell3d.mme_draw.instance_count = instance_count;
23 maxwell3d.regs.vb_element_base = parameters[3]; 22 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) {
281 VkBufferMemoryBarrier barrier; 281 VkBufferMemoryBarrier barrier;
282 barrier.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER; 282 barrier.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER;
283 barrier.pNext = nullptr; 283 barrier.pNext = nullptr;
284 barrier.srcAccessMask = VK_PIPELINE_STAGE_TRANSFER_BIT; 284 barrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
285 barrier.dstAccessMask = VK_PIPELINE_STAGE_VERTEX_SHADER_BIT; 285 barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
286 barrier.srcQueueFamilyIndex = VK_ACCESS_TRANSFER_WRITE_BIT; 286 barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; // They'll be ignored anyway
287 barrier.dstQueueFamilyIndex = VK_ACCESS_SHADER_READ_BIT; 287 barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
288 barrier.srcQueueFamilyIndex = 0;
289 barrier.dstQueueFamilyIndex = 0;
290 barrier.buffer = dst_buffer; 288 barrier.buffer = dst_buffer;
291 barrier.offset = 0; 289 barrier.offset = 0;
292 barrier.size = size; 290 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:
209 } 209 }
210 210
211 // Remove them from the cache 211 // Remove them from the cache
212 const auto is_removed = [&removed_shaders](std::unique_ptr<T>& shader) { 212 const auto is_removed = [&removed_shaders](const std::unique_ptr<T>& shader) {
213 return std::find(removed_shaders.begin(), removed_shaders.end(), shader.get()) != 213 return std::find(removed_shaders.begin(), removed_shaders.end(), shader.get()) !=
214 removed_shaders.end(); 214 removed_shaders.end();
215 }; 215 };
216 storage.erase(std::remove_if(storage.begin(), storage.end(), is_removed), storage.end()); 216 std::erase_if(storage, is_removed);
217 } 217 }
218 218
219 /// @brief Creates a new entry in the lookup cache and returns its pointer 219 /// @brief Creates a new entry in the lookup cache and returns its pointer