diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/fiber.cpp | 4 | ||||
| -rw-r--r-- | src/common/fiber.h | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 5 | ||||
| -rw-r--r-- | src/tests/common/fibers.cpp | 71 | ||||
| -rw-r--r-- | src/video_core/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/video_core/command_classes/codecs/vp9.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/wrapper.cpp | 2 | ||||
| -rw-r--r-- | src/web_service/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/web_service/web_backend.cpp | 20 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 12 | ||||
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu_cmd/default_ini.h | 4 |
13 files changed, 63 insertions, 75 deletions
diff --git a/src/common/fiber.cpp b/src/common/fiber.cpp index 1c1d09ccb..e186ed880 100644 --- a/src/common/fiber.cpp +++ b/src/common/fiber.cpp | |||
| @@ -91,7 +91,7 @@ void Fiber::Rewind() { | |||
| 91 | SwitchToFiber(impl->rewind_handle); | 91 | SwitchToFiber(impl->rewind_handle); |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | void Fiber::YieldTo(std::shared_ptr<Fiber>& from, std::shared_ptr<Fiber>& to) { | 94 | void Fiber::YieldTo(std::shared_ptr<Fiber> from, std::shared_ptr<Fiber> to) { |
| 95 | ASSERT_MSG(from != nullptr, "Yielding fiber is null!"); | 95 | ASSERT_MSG(from != nullptr, "Yielding fiber is null!"); |
| 96 | ASSERT_MSG(to != nullptr, "Next fiber is null!"); | 96 | ASSERT_MSG(to != nullptr, "Next fiber is null!"); |
| 97 | to->guard.lock(); | 97 | to->guard.lock(); |
| @@ -199,7 +199,7 @@ void Fiber::Rewind() { | |||
| 199 | boost::context::detail::jump_fcontext(impl->rewind_context, this); | 199 | boost::context::detail::jump_fcontext(impl->rewind_context, this); |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | void Fiber::YieldTo(std::shared_ptr<Fiber>& from, std::shared_ptr<Fiber>& to) { | 202 | void Fiber::YieldTo(std::shared_ptr<Fiber> from, std::shared_ptr<Fiber> to) { |
| 203 | ASSERT_MSG(from != nullptr, "Yielding fiber is null!"); | 203 | ASSERT_MSG(from != nullptr, "Yielding fiber is null!"); |
| 204 | ASSERT_MSG(to != nullptr, "Next fiber is null!"); | 204 | ASSERT_MSG(to != nullptr, "Next fiber is null!"); |
| 205 | to->guard.lock(); | 205 | to->guard.lock(); |
diff --git a/src/common/fiber.h b/src/common/fiber.h index 89dde5e36..cefd61df9 100644 --- a/src/common/fiber.h +++ b/src/common/fiber.h | |||
| @@ -46,7 +46,7 @@ public: | |||
| 46 | 46 | ||
| 47 | /// Yields control from Fiber 'from' to Fiber 'to' | 47 | /// Yields control from Fiber 'from' to Fiber 'to' |
| 48 | /// Fiber 'from' must be the currently running fiber. | 48 | /// Fiber 'from' must be the currently running fiber. |
| 49 | static void YieldTo(std::shared_ptr<Fiber>& from, std::shared_ptr<Fiber>& to); | 49 | static void YieldTo(std::shared_ptr<Fiber> from, std::shared_ptr<Fiber> to); |
| 50 | [[nodiscard]] static std::shared_ptr<Fiber> ThreadToFiber(); | 50 | [[nodiscard]] static std::shared_ptr<Fiber> ThreadToFiber(); |
| 51 | 51 | ||
| 52 | void SetRewindPoint(std::function<void(void*)>&& rewind_func, void* start_parameter); | 52 | void SetRewindPoint(std::function<void(void*)>&& rewind_func, void* start_parameter); |
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index b2b5b8adf..bb3e312a7 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -86,8 +86,6 @@ struct KernelCore::Impl { | |||
| 86 | } | 86 | } |
| 87 | cores.clear(); | 87 | cores.clear(); |
| 88 | 88 | ||
| 89 | registered_core_threads.reset(); | ||
| 90 | |||
| 91 | process_list.clear(); | 89 | process_list.clear(); |
| 92 | current_process = nullptr; | 90 | current_process = nullptr; |
| 93 | 91 | ||
| @@ -199,9 +197,7 @@ struct KernelCore::Impl { | |||
| 199 | const auto it = std::find(register_host_thread_keys.begin(), end, this_id); | 197 | const auto it = std::find(register_host_thread_keys.begin(), end, this_id); |
| 200 | ASSERT(core_id < Core::Hardware::NUM_CPU_CORES); | 198 | ASSERT(core_id < Core::Hardware::NUM_CPU_CORES); |
| 201 | ASSERT(it == end); | 199 | ASSERT(it == end); |
| 202 | ASSERT(!registered_core_threads[core_id]); | ||
| 203 | InsertHostThread(static_cast<u32>(core_id)); | 200 | InsertHostThread(static_cast<u32>(core_id)); |
| 204 | registered_core_threads.set(core_id); | ||
| 205 | } | 201 | } |
| 206 | 202 | ||
| 207 | void RegisterHostThread() { | 203 | void RegisterHostThread() { |
| @@ -332,7 +328,6 @@ struct KernelCore::Impl { | |||
| 332 | 328 | ||
| 333 | // 0-3 IDs represent core threads, >3 represent others | 329 | // 0-3 IDs represent core threads, >3 represent others |
| 334 | std::atomic<u32> registered_thread_ids{Core::Hardware::NUM_CPU_CORES}; | 330 | std::atomic<u32> registered_thread_ids{Core::Hardware::NUM_CPU_CORES}; |
| 335 | std::bitset<Core::Hardware::NUM_CPU_CORES> registered_core_threads; | ||
| 336 | 331 | ||
| 337 | // Number of host threads is a relatively high number to avoid overflowing | 332 | // Number of host threads is a relatively high number to avoid overflowing |
| 338 | static constexpr size_t NUM_REGISTRABLE_HOST_THREADS = 64; | 333 | static constexpr size_t NUM_REGISTRABLE_HOST_THREADS = 64; |
diff --git a/src/tests/common/fibers.cpp b/src/tests/common/fibers.cpp index 4fd92428f..4757dd2b4 100644 --- a/src/tests/common/fibers.cpp +++ b/src/tests/common/fibers.cpp | |||
| @@ -6,18 +6,40 @@ | |||
| 6 | #include <cstdlib> | 6 | #include <cstdlib> |
| 7 | #include <functional> | 7 | #include <functional> |
| 8 | #include <memory> | 8 | #include <memory> |
| 9 | #include <mutex> | ||
| 10 | #include <stdexcept> | ||
| 9 | #include <thread> | 11 | #include <thread> |
| 10 | #include <unordered_map> | 12 | #include <unordered_map> |
| 11 | #include <vector> | 13 | #include <vector> |
| 12 | 14 | ||
| 13 | #include <catch2/catch.hpp> | 15 | #include <catch2/catch.hpp> |
| 14 | #include <math.h> | 16 | |
| 15 | #include "common/common_types.h" | 17 | #include "common/common_types.h" |
| 16 | #include "common/fiber.h" | 18 | #include "common/fiber.h" |
| 17 | #include "common/spin_lock.h" | ||
| 18 | 19 | ||
| 19 | namespace Common { | 20 | namespace Common { |
| 20 | 21 | ||
| 22 | class ThreadIds { | ||
| 23 | public: | ||
| 24 | void Register(u32 id) { | ||
| 25 | const auto thread_id = std::this_thread::get_id(); | ||
| 26 | std::scoped_lock lock{mutex}; | ||
| 27 | if (ids.contains(thread_id)) { | ||
| 28 | throw std::logic_error{"Registering the same thread twice"}; | ||
| 29 | } | ||
| 30 | ids.emplace(thread_id, id); | ||
| 31 | } | ||
| 32 | |||
| 33 | [[nodiscard]] u32 Get() const { | ||
| 34 | std::scoped_lock lock{mutex}; | ||
| 35 | return ids.at(std::this_thread::get_id()); | ||
| 36 | } | ||
| 37 | |||
| 38 | private: | ||
| 39 | mutable std::mutex mutex; | ||
| 40 | std::unordered_map<std::thread::id, u32> ids; | ||
| 41 | }; | ||
| 42 | |||
| 21 | class TestControl1 { | 43 | class TestControl1 { |
| 22 | public: | 44 | public: |
| 23 | TestControl1() = default; | 45 | TestControl1() = default; |
| @@ -26,7 +48,7 @@ public: | |||
| 26 | 48 | ||
| 27 | void ExecuteThread(u32 id); | 49 | void ExecuteThread(u32 id); |
| 28 | 50 | ||
| 29 | std::unordered_map<std::thread::id, u32> ids; | 51 | ThreadIds thread_ids; |
| 30 | std::vector<std::shared_ptr<Common::Fiber>> thread_fibers; | 52 | std::vector<std::shared_ptr<Common::Fiber>> thread_fibers; |
| 31 | std::vector<std::shared_ptr<Common::Fiber>> work_fibers; | 53 | std::vector<std::shared_ptr<Common::Fiber>> work_fibers; |
| 32 | std::vector<u32> items; | 54 | std::vector<u32> items; |
| @@ -39,8 +61,7 @@ static void WorkControl1(void* control) { | |||
| 39 | } | 61 | } |
| 40 | 62 | ||
| 41 | void TestControl1::DoWork() { | 63 | void TestControl1::DoWork() { |
| 42 | std::thread::id this_id = std::this_thread::get_id(); | 64 | const u32 id = thread_ids.Get(); |
| 43 | u32 id = ids[this_id]; | ||
| 44 | u32 value = items[id]; | 65 | u32 value = items[id]; |
| 45 | for (u32 i = 0; i < id; i++) { | 66 | for (u32 i = 0; i < id; i++) { |
| 46 | value++; | 67 | value++; |
| @@ -50,8 +71,7 @@ void TestControl1::DoWork() { | |||
| 50 | } | 71 | } |
| 51 | 72 | ||
| 52 | void TestControl1::ExecuteThread(u32 id) { | 73 | void TestControl1::ExecuteThread(u32 id) { |
| 53 | std::thread::id this_id = std::this_thread::get_id(); | 74 | thread_ids.Register(id); |
| 54 | ids[this_id] = id; | ||
| 55 | auto thread_fiber = Fiber::ThreadToFiber(); | 75 | auto thread_fiber = Fiber::ThreadToFiber(); |
| 56 | thread_fibers[id] = thread_fiber; | 76 | thread_fibers[id] = thread_fiber; |
| 57 | work_fibers[id] = std::make_shared<Fiber>(std::function<void(void*)>{WorkControl1}, this); | 77 | work_fibers[id] = std::make_shared<Fiber>(std::function<void(void*)>{WorkControl1}, this); |
| @@ -98,8 +118,7 @@ public: | |||
| 98 | value1 += i; | 118 | value1 += i; |
| 99 | } | 119 | } |
| 100 | Fiber::YieldTo(fiber1, fiber3); | 120 | Fiber::YieldTo(fiber1, fiber3); |
| 101 | std::thread::id this_id = std::this_thread::get_id(); | 121 | const u32 id = thread_ids.Get(); |
| 102 | u32 id = ids[this_id]; | ||
| 103 | assert1 = id == 1; | 122 | assert1 = id == 1; |
| 104 | value2 += 5000; | 123 | value2 += 5000; |
| 105 | Fiber::YieldTo(fiber1, thread_fibers[id]); | 124 | Fiber::YieldTo(fiber1, thread_fibers[id]); |
| @@ -115,8 +134,7 @@ public: | |||
| 115 | } | 134 | } |
| 116 | 135 | ||
| 117 | void DoWork3() { | 136 | void DoWork3() { |
| 118 | std::thread::id this_id = std::this_thread::get_id(); | 137 | const u32 id = thread_ids.Get(); |
| 119 | u32 id = ids[this_id]; | ||
| 120 | assert2 = id == 0; | 138 | assert2 = id == 0; |
| 121 | value1 += 1000; | 139 | value1 += 1000; |
| 122 | Fiber::YieldTo(fiber3, thread_fibers[id]); | 140 | Fiber::YieldTo(fiber3, thread_fibers[id]); |
| @@ -125,14 +143,12 @@ public: | |||
| 125 | void ExecuteThread(u32 id); | 143 | void ExecuteThread(u32 id); |
| 126 | 144 | ||
| 127 | void CallFiber1() { | 145 | void CallFiber1() { |
| 128 | std::thread::id this_id = std::this_thread::get_id(); | 146 | const u32 id = thread_ids.Get(); |
| 129 | u32 id = ids[this_id]; | ||
| 130 | Fiber::YieldTo(thread_fibers[id], fiber1); | 147 | Fiber::YieldTo(thread_fibers[id], fiber1); |
| 131 | } | 148 | } |
| 132 | 149 | ||
| 133 | void CallFiber2() { | 150 | void CallFiber2() { |
| 134 | std::thread::id this_id = std::this_thread::get_id(); | 151 | const u32 id = thread_ids.Get(); |
| 135 | u32 id = ids[this_id]; | ||
| 136 | Fiber::YieldTo(thread_fibers[id], fiber2); | 152 | Fiber::YieldTo(thread_fibers[id], fiber2); |
| 137 | } | 153 | } |
| 138 | 154 | ||
| @@ -145,7 +161,7 @@ public: | |||
| 145 | u32 value2{}; | 161 | u32 value2{}; |
| 146 | std::atomic<bool> trap{true}; | 162 | std::atomic<bool> trap{true}; |
| 147 | std::atomic<bool> trap2{true}; | 163 | std::atomic<bool> trap2{true}; |
| 148 | std::unordered_map<std::thread::id, u32> ids; | 164 | ThreadIds thread_ids; |
| 149 | std::vector<std::shared_ptr<Common::Fiber>> thread_fibers; | 165 | std::vector<std::shared_ptr<Common::Fiber>> thread_fibers; |
| 150 | std::shared_ptr<Common::Fiber> fiber1; | 166 | std::shared_ptr<Common::Fiber> fiber1; |
| 151 | std::shared_ptr<Common::Fiber> fiber2; | 167 | std::shared_ptr<Common::Fiber> fiber2; |
| @@ -168,15 +184,13 @@ static void WorkControl2_3(void* control) { | |||
| 168 | } | 184 | } |
| 169 | 185 | ||
| 170 | void TestControl2::ExecuteThread(u32 id) { | 186 | void TestControl2::ExecuteThread(u32 id) { |
| 171 | std::thread::id this_id = std::this_thread::get_id(); | 187 | thread_ids.Register(id); |
| 172 | ids[this_id] = id; | ||
| 173 | auto thread_fiber = Fiber::ThreadToFiber(); | 188 | auto thread_fiber = Fiber::ThreadToFiber(); |
| 174 | thread_fibers[id] = thread_fiber; | 189 | thread_fibers[id] = thread_fiber; |
| 175 | } | 190 | } |
| 176 | 191 | ||
| 177 | void TestControl2::Exit() { | 192 | void TestControl2::Exit() { |
| 178 | std::thread::id this_id = std::this_thread::get_id(); | 193 | const u32 id = thread_ids.Get(); |
| 179 | u32 id = ids[this_id]; | ||
| 180 | thread_fibers[id]->Exit(); | 194 | thread_fibers[id]->Exit(); |
| 181 | } | 195 | } |
| 182 | 196 | ||
| @@ -228,24 +242,21 @@ public: | |||
| 228 | void DoWork1() { | 242 | void DoWork1() { |
| 229 | value1 += 1; | 243 | value1 += 1; |
| 230 | Fiber::YieldTo(fiber1, fiber2); | 244 | Fiber::YieldTo(fiber1, fiber2); |
| 231 | std::thread::id this_id = std::this_thread::get_id(); | 245 | const u32 id = thread_ids.Get(); |
| 232 | u32 id = ids[this_id]; | ||
| 233 | value3 += 1; | 246 | value3 += 1; |
| 234 | Fiber::YieldTo(fiber1, thread_fibers[id]); | 247 | Fiber::YieldTo(fiber1, thread_fibers[id]); |
| 235 | } | 248 | } |
| 236 | 249 | ||
| 237 | void DoWork2() { | 250 | void DoWork2() { |
| 238 | value2 += 1; | 251 | value2 += 1; |
| 239 | std::thread::id this_id = std::this_thread::get_id(); | 252 | const u32 id = thread_ids.Get(); |
| 240 | u32 id = ids[this_id]; | ||
| 241 | Fiber::YieldTo(fiber2, thread_fibers[id]); | 253 | Fiber::YieldTo(fiber2, thread_fibers[id]); |
| 242 | } | 254 | } |
| 243 | 255 | ||
| 244 | void ExecuteThread(u32 id); | 256 | void ExecuteThread(u32 id); |
| 245 | 257 | ||
| 246 | void CallFiber1() { | 258 | void CallFiber1() { |
| 247 | std::thread::id this_id = std::this_thread::get_id(); | 259 | const u32 id = thread_ids.Get(); |
| 248 | u32 id = ids[this_id]; | ||
| 249 | Fiber::YieldTo(thread_fibers[id], fiber1); | 260 | Fiber::YieldTo(thread_fibers[id], fiber1); |
| 250 | } | 261 | } |
| 251 | 262 | ||
| @@ -254,7 +265,7 @@ public: | |||
| 254 | u32 value1{}; | 265 | u32 value1{}; |
| 255 | u32 value2{}; | 266 | u32 value2{}; |
| 256 | u32 value3{}; | 267 | u32 value3{}; |
| 257 | std::unordered_map<std::thread::id, u32> ids; | 268 | ThreadIds thread_ids; |
| 258 | std::vector<std::shared_ptr<Common::Fiber>> thread_fibers; | 269 | std::vector<std::shared_ptr<Common::Fiber>> thread_fibers; |
| 259 | std::shared_ptr<Common::Fiber> fiber1; | 270 | std::shared_ptr<Common::Fiber> fiber1; |
| 260 | std::shared_ptr<Common::Fiber> fiber2; | 271 | std::shared_ptr<Common::Fiber> fiber2; |
| @@ -271,15 +282,13 @@ static void WorkControl3_2(void* control) { | |||
| 271 | } | 282 | } |
| 272 | 283 | ||
| 273 | void TestControl3::ExecuteThread(u32 id) { | 284 | void TestControl3::ExecuteThread(u32 id) { |
| 274 | std::thread::id this_id = std::this_thread::get_id(); | 285 | thread_ids.Register(id); |
| 275 | ids[this_id] = id; | ||
| 276 | auto thread_fiber = Fiber::ThreadToFiber(); | 286 | auto thread_fiber = Fiber::ThreadToFiber(); |
| 277 | thread_fibers[id] = thread_fiber; | 287 | thread_fibers[id] = thread_fiber; |
| 278 | } | 288 | } |
| 279 | 289 | ||
| 280 | void TestControl3::Exit() { | 290 | void TestControl3::Exit() { |
| 281 | std::thread::id this_id = std::this_thread::get_id(); | 291 | const u32 id = thread_ids.Get(); |
| 282 | u32 id = ids[this_id]; | ||
| 283 | thread_fibers[id]->Exit(); | 292 | thread_fibers[id]->Exit(); |
| 284 | } | 293 | } |
| 285 | 294 | ||
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index fdfc885fc..abcee2a1c 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt | |||
| @@ -302,7 +302,10 @@ else() | |||
| 302 | target_compile_options(video_core PRIVATE | 302 | target_compile_options(video_core PRIVATE |
| 303 | -Werror=conversion | 303 | -Werror=conversion |
| 304 | -Wno-error=sign-conversion | 304 | -Wno-error=sign-conversion |
| 305 | -Werror=pessimizing-move | ||
| 306 | -Werror=redundant-move | ||
| 305 | -Werror=switch | 307 | -Werror=switch |
| 308 | -Werror=type-limits | ||
| 306 | -Werror=unused-variable | 309 | -Werror=unused-variable |
| 307 | 310 | ||
| 308 | $<$<CXX_COMPILER_ID:GNU>:-Werror=class-memaccess> | 311 | $<$<CXX_COMPILER_ID:GNU>:-Werror=class-memaccess> |
diff --git a/src/video_core/command_classes/codecs/vp9.cpp b/src/video_core/command_classes/codecs/vp9.cpp index 3bae0bb5d..d205a8f5d 100644 --- a/src/video_core/command_classes/codecs/vp9.cpp +++ b/src/video_core/command_classes/codecs/vp9.cpp | |||
| @@ -366,7 +366,7 @@ Vp9PictureInfo VP9::GetVp9PictureInfo(const NvdecCommon::NvdecRegisters& state) | |||
| 366 | // to avoid buffering frame data needed for reference frame updating in the header composition. | 366 | // to avoid buffering frame data needed for reference frame updating in the header composition. |
| 367 | std::memcpy(vp9_info.frame_offsets.data(), state.surface_luma_offset.data(), 4 * sizeof(u64)); | 367 | std::memcpy(vp9_info.frame_offsets.data(), state.surface_luma_offset.data(), 4 * sizeof(u64)); |
| 368 | 368 | ||
| 369 | return std::move(vp9_info); | 369 | return vp9_info; |
| 370 | } | 370 | } |
| 371 | 371 | ||
| 372 | void VP9::InsertEntropy(u64 offset, Vp9EntropyProbs& dst) { | 372 | void VP9::InsertEntropy(u64 offset, Vp9EntropyProbs& dst) { |
| @@ -893,7 +893,7 @@ void VpxRangeEncoder::Write(bool bit, s32 probability) { | |||
| 893 | if (((low_value << (offset - 1)) >> 31) != 0) { | 893 | if (((low_value << (offset - 1)) >> 31) != 0) { |
| 894 | const s32 current_pos = static_cast<s32>(base_stream.GetPosition()); | 894 | const s32 current_pos = static_cast<s32>(base_stream.GetPosition()); |
| 895 | base_stream.Seek(-1, Common::SeekOrigin::FromCurrentPos); | 895 | base_stream.Seek(-1, Common::SeekOrigin::FromCurrentPos); |
| 896 | while (base_stream.GetPosition() >= 0 && PeekByte() == 0xff) { | 896 | while (PeekByte() == 0xff) { |
| 897 | base_stream.WriteByte(0); | 897 | base_stream.WriteByte(0); |
| 898 | 898 | ||
| 899 | base_stream.Seek(-2, Common::SeekOrigin::FromCurrentPos); | 899 | base_stream.Seek(-2, Common::SeekOrigin::FromCurrentPos); |
diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp index 166ee34e1..70dd0c3c6 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | |||
| @@ -317,8 +317,7 @@ std::optional<std::vector<ShaderDiskCachePrecompiled>> ShaderDiskCacheOpenGL::Lo | |||
| 317 | return std::nullopt; | 317 | return std::nullopt; |
| 318 | } | 318 | } |
| 319 | } | 319 | } |
| 320 | 320 | return entries; | |
| 321 | return std::move(entries); | ||
| 322 | } | 321 | } |
| 323 | 322 | ||
| 324 | void ShaderDiskCacheOpenGL::InvalidateTransferable() { | 323 | void ShaderDiskCacheOpenGL::InvalidateTransferable() { |
diff --git a/src/video_core/renderer_vulkan/wrapper.cpp b/src/video_core/renderer_vulkan/wrapper.cpp index c034558a3..4e83303d8 100644 --- a/src/video_core/renderer_vulkan/wrapper.cpp +++ b/src/video_core/renderer_vulkan/wrapper.cpp | |||
| @@ -844,7 +844,7 @@ std::optional<std::vector<VkExtensionProperties>> EnumerateInstanceExtensionProp | |||
| 844 | VK_SUCCESS) { | 844 | VK_SUCCESS) { |
| 845 | return std::nullopt; | 845 | return std::nullopt; |
| 846 | } | 846 | } |
| 847 | return std::move(properties); | 847 | return properties; |
| 848 | } | 848 | } |
| 849 | 849 | ||
| 850 | std::optional<std::vector<VkLayerProperties>> EnumerateInstanceLayerProperties( | 850 | std::optional<std::vector<VkLayerProperties>> EnumerateInstanceLayerProperties( |
diff --git a/src/web_service/CMakeLists.txt b/src/web_service/CMakeLists.txt index 7e484b906..ae85a72ea 100644 --- a/src/web_service/CMakeLists.txt +++ b/src/web_service/CMakeLists.txt | |||
| @@ -9,4 +9,4 @@ add_library(web_service STATIC | |||
| 9 | ) | 9 | ) |
| 10 | 10 | ||
| 11 | create_target_directory_groups(web_service) | 11 | create_target_directory_groups(web_service) |
| 12 | target_link_libraries(web_service PRIVATE common nlohmann_json::nlohmann_json httplib lurlparser) | 12 | target_link_libraries(web_service PRIVATE common nlohmann_json::nlohmann_json httplib) |
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index 534960d09..c56cd7c71 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | #include <mutex> | 7 | #include <mutex> |
| 8 | #include <string> | 8 | #include <string> |
| 9 | 9 | ||
| 10 | #include <LUrlParser.h> | ||
| 11 | #include <fmt/format.h> | 10 | #include <fmt/format.h> |
| 12 | #include <httplib.h> | 11 | #include <httplib.h> |
| 13 | 12 | ||
| @@ -19,9 +18,6 @@ namespace WebService { | |||
| 19 | 18 | ||
| 20 | constexpr std::array<const char, 1> API_VERSION{'1'}; | 19 | constexpr std::array<const char, 1> API_VERSION{'1'}; |
| 21 | 20 | ||
| 22 | constexpr int HTTP_PORT = 80; | ||
| 23 | constexpr int HTTPS_PORT = 443; | ||
| 24 | |||
| 25 | constexpr std::size_t TIMEOUT_SECONDS = 30; | 21 | constexpr std::size_t TIMEOUT_SECONDS = 30; |
| 26 | 22 | ||
| 27 | struct Client::Impl { | 23 | struct Client::Impl { |
| @@ -67,21 +63,7 @@ struct Client::Impl { | |||
| 67 | const std::string& jwt = "", const std::string& username = "", | 63 | const std::string& jwt = "", const std::string& username = "", |
| 68 | const std::string& token = "") { | 64 | const std::string& token = "") { |
| 69 | if (cli == nullptr) { | 65 | if (cli == nullptr) { |
| 70 | const auto parsedUrl = LUrlParser::clParseURL::ParseURL(host); | 66 | cli = std::make_unique<httplib::Client>(host.c_str()); |
| 71 | int port{}; | ||
| 72 | if (parsedUrl.m_Scheme == "http") { | ||
| 73 | if (!parsedUrl.GetPort(&port)) { | ||
| 74 | port = HTTP_PORT; | ||
| 75 | } | ||
| 76 | } else if (parsedUrl.m_Scheme == "https") { | ||
| 77 | if (!parsedUrl.GetPort(&port)) { | ||
| 78 | port = HTTPS_PORT; | ||
| 79 | } | ||
| 80 | } else { | ||
| 81 | LOG_ERROR(WebService, "Bad URL scheme {}", parsedUrl.m_Scheme); | ||
| 82 | return WebResult{WebResult::Code::InvalidURL, "Bad URL scheme", ""}; | ||
| 83 | } | ||
| 84 | cli = std::make_unique<httplib::Client>(parsedUrl.m_Host.c_str(), port); | ||
| 85 | } | 67 | } |
| 86 | cli->set_connection_timeout(TIMEOUT_SECONDS); | 68 | cli->set_connection_timeout(TIMEOUT_SECONDS); |
| 87 | cli->set_read_timeout(TIMEOUT_SECONDS); | 69 | cli->set_read_timeout(TIMEOUT_SECONDS); |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index abbc83929..1ce62e4a6 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -515,7 +515,7 @@ void Config::ReadMotionTouchValues() { | |||
| 515 | void Config::ReadCoreValues() { | 515 | void Config::ReadCoreValues() { |
| 516 | qt_config->beginGroup(QStringLiteral("Core")); | 516 | qt_config->beginGroup(QStringLiteral("Core")); |
| 517 | 517 | ||
| 518 | ReadSettingGlobal(Settings::values.use_multi_core, QStringLiteral("use_multi_core"), false); | 518 | ReadSettingGlobal(Settings::values.use_multi_core, QStringLiteral("use_multi_core"), true); |
| 519 | 519 | ||
| 520 | qt_config->endGroup(); | 520 | qt_config->endGroup(); |
| 521 | } | 521 | } |
| @@ -716,12 +716,12 @@ void Config::ReadRendererValues() { | |||
| 716 | QStringLiteral("use_disk_shader_cache"), true); | 716 | QStringLiteral("use_disk_shader_cache"), true); |
| 717 | ReadSettingGlobal(Settings::values.gpu_accuracy, QStringLiteral("gpu_accuracy"), 0); | 717 | ReadSettingGlobal(Settings::values.gpu_accuracy, QStringLiteral("gpu_accuracy"), 0); |
| 718 | ReadSettingGlobal(Settings::values.use_asynchronous_gpu_emulation, | 718 | ReadSettingGlobal(Settings::values.use_asynchronous_gpu_emulation, |
| 719 | QStringLiteral("use_asynchronous_gpu_emulation"), false); | 719 | QStringLiteral("use_asynchronous_gpu_emulation"), true); |
| 720 | ReadSettingGlobal(Settings::values.use_nvdec_emulation, QStringLiteral("use_nvdec_emulation"), | 720 | ReadSettingGlobal(Settings::values.use_nvdec_emulation, QStringLiteral("use_nvdec_emulation"), |
| 721 | true); | 721 | true); |
| 722 | ReadSettingGlobal(Settings::values.use_vsync, QStringLiteral("use_vsync"), true); | 722 | ReadSettingGlobal(Settings::values.use_vsync, QStringLiteral("use_vsync"), true); |
| 723 | ReadSettingGlobal(Settings::values.use_assembly_shaders, QStringLiteral("use_assembly_shaders"), | 723 | ReadSettingGlobal(Settings::values.use_assembly_shaders, QStringLiteral("use_assembly_shaders"), |
| 724 | false); | 724 | true); |
| 725 | ReadSettingGlobal(Settings::values.use_asynchronous_shaders, | 725 | ReadSettingGlobal(Settings::values.use_asynchronous_shaders, |
| 726 | QStringLiteral("use_asynchronous_shaders"), false); | 726 | QStringLiteral("use_asynchronous_shaders"), false); |
| 727 | ReadSettingGlobal(Settings::values.use_fast_gpu_time, QStringLiteral("use_fast_gpu_time"), | 727 | ReadSettingGlobal(Settings::values.use_fast_gpu_time, QStringLiteral("use_fast_gpu_time"), |
| @@ -1110,7 +1110,7 @@ void Config::SaveControlValues() { | |||
| 1110 | void Config::SaveCoreValues() { | 1110 | void Config::SaveCoreValues() { |
| 1111 | qt_config->beginGroup(QStringLiteral("Core")); | 1111 | qt_config->beginGroup(QStringLiteral("Core")); |
| 1112 | 1112 | ||
| 1113 | WriteSettingGlobal(QStringLiteral("use_multi_core"), Settings::values.use_multi_core, false); | 1113 | WriteSettingGlobal(QStringLiteral("use_multi_core"), Settings::values.use_multi_core, true); |
| 1114 | 1114 | ||
| 1115 | qt_config->endGroup(); | 1115 | qt_config->endGroup(); |
| 1116 | } | 1116 | } |
| @@ -1266,12 +1266,12 @@ void Config::SaveRendererValues() { | |||
| 1266 | static_cast<int>(Settings::values.gpu_accuracy.GetValue(global)), | 1266 | static_cast<int>(Settings::values.gpu_accuracy.GetValue(global)), |
| 1267 | Settings::values.gpu_accuracy.UsingGlobal(), 0); | 1267 | Settings::values.gpu_accuracy.UsingGlobal(), 0); |
| 1268 | WriteSettingGlobal(QStringLiteral("use_asynchronous_gpu_emulation"), | 1268 | WriteSettingGlobal(QStringLiteral("use_asynchronous_gpu_emulation"), |
| 1269 | Settings::values.use_asynchronous_gpu_emulation, false); | 1269 | Settings::values.use_asynchronous_gpu_emulation, true); |
| 1270 | WriteSettingGlobal(QStringLiteral("use_nvdec_emulation"), Settings::values.use_nvdec_emulation, | 1270 | WriteSettingGlobal(QStringLiteral("use_nvdec_emulation"), Settings::values.use_nvdec_emulation, |
| 1271 | true); | 1271 | true); |
| 1272 | WriteSettingGlobal(QStringLiteral("use_vsync"), Settings::values.use_vsync, true); | 1272 | WriteSettingGlobal(QStringLiteral("use_vsync"), Settings::values.use_vsync, true); |
| 1273 | WriteSettingGlobal(QStringLiteral("use_assembly_shaders"), | 1273 | WriteSettingGlobal(QStringLiteral("use_assembly_shaders"), |
| 1274 | Settings::values.use_assembly_shaders, false); | 1274 | Settings::values.use_assembly_shaders, true); |
| 1275 | WriteSettingGlobal(QStringLiteral("use_asynchronous_shaders"), | 1275 | WriteSettingGlobal(QStringLiteral("use_asynchronous_shaders"), |
| 1276 | Settings::values.use_asynchronous_shaders, false); | 1276 | Settings::values.use_asynchronous_shaders, false); |
| 1277 | WriteSettingGlobal(QStringLiteral("use_fast_gpu_time"), Settings::values.use_fast_gpu_time, | 1277 | WriteSettingGlobal(QStringLiteral("use_fast_gpu_time"), Settings::values.use_fast_gpu_time, |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 23448e747..334038ef9 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -371,7 +371,7 @@ void Config::ReadValues() { | |||
| 371 | 371 | ||
| 372 | // Core | 372 | // Core |
| 373 | Settings::values.use_multi_core.SetValue( | 373 | Settings::values.use_multi_core.SetValue( |
| 374 | sdl2_config->GetBoolean("Core", "use_multi_core", false)); | 374 | sdl2_config->GetBoolean("Core", "use_multi_core", true)); |
| 375 | 375 | ||
| 376 | // Renderer | 376 | // Renderer |
| 377 | const int renderer_backend = sdl2_config->GetInteger( | 377 | const int renderer_backend = sdl2_config->GetInteger( |
| @@ -395,11 +395,11 @@ void Config::ReadValues() { | |||
| 395 | const int gpu_accuracy_level = sdl2_config->GetInteger("Renderer", "gpu_accuracy", 0); | 395 | const int gpu_accuracy_level = sdl2_config->GetInteger("Renderer", "gpu_accuracy", 0); |
| 396 | Settings::values.gpu_accuracy.SetValue(static_cast<Settings::GPUAccuracy>(gpu_accuracy_level)); | 396 | Settings::values.gpu_accuracy.SetValue(static_cast<Settings::GPUAccuracy>(gpu_accuracy_level)); |
| 397 | Settings::values.use_asynchronous_gpu_emulation.SetValue( | 397 | Settings::values.use_asynchronous_gpu_emulation.SetValue( |
| 398 | sdl2_config->GetBoolean("Renderer", "use_asynchronous_gpu_emulation", false)); | 398 | sdl2_config->GetBoolean("Renderer", "use_asynchronous_gpu_emulation", true)); |
| 399 | Settings::values.use_vsync.SetValue( | 399 | Settings::values.use_vsync.SetValue( |
| 400 | static_cast<u16>(sdl2_config->GetInteger("Renderer", "use_vsync", 1))); | 400 | static_cast<u16>(sdl2_config->GetInteger("Renderer", "use_vsync", 1))); |
| 401 | Settings::values.use_assembly_shaders.SetValue( | 401 | Settings::values.use_assembly_shaders.SetValue( |
| 402 | sdl2_config->GetBoolean("Renderer", "use_assembly_shaders", false)); | 402 | sdl2_config->GetBoolean("Renderer", "use_assembly_shaders", true)); |
| 403 | Settings::values.use_asynchronous_shaders.SetValue( | 403 | Settings::values.use_asynchronous_shaders.SetValue( |
| 404 | sdl2_config->GetBoolean("Renderer", "use_asynchronous_shaders", false)); | 404 | sdl2_config->GetBoolean("Renderer", "use_asynchronous_shaders", false)); |
| 405 | Settings::values.use_asynchronous_shaders.SetValue( | 405 | Settings::values.use_asynchronous_shaders.SetValue( |
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index aa9e40380..796e27df4 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -94,7 +94,7 @@ udp_pad_index= | |||
| 94 | 94 | ||
| 95 | [Core] | 95 | [Core] |
| 96 | # Whether to use multi-core for CPU emulation | 96 | # Whether to use multi-core for CPU emulation |
| 97 | # 0 (default): Disabled, 1: Enabled | 97 | # 0: Disabled, 1 (default): Enabled |
| 98 | use_multi_core= | 98 | use_multi_core= |
| 99 | 99 | ||
| 100 | [Cpu] | 100 | [Cpu] |
| @@ -163,7 +163,7 @@ max_anisotropy = | |||
| 163 | use_vsync = | 163 | use_vsync = |
| 164 | 164 | ||
| 165 | # Whether to use OpenGL assembly shaders or not. NV_gpu_program5 is required. | 165 | # Whether to use OpenGL assembly shaders or not. NV_gpu_program5 is required. |
| 166 | # 0 (default): Off, 1: On | 166 | # 0: Off, 1 (default): On |
| 167 | use_assembly_shaders = | 167 | use_assembly_shaders = |
| 168 | 168 | ||
| 169 | # Whether to allow asynchronous shader building. | 169 | # Whether to allow asynchronous shader building. |