summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/threadsafe_queue.h10
-rw-r--r--src/input_common/sdl/sdl_impl.cpp3
-rw-r--r--src/video_core/command_classes/vic.cpp5
3 files changed, 9 insertions, 9 deletions
diff --git a/src/common/threadsafe_queue.h b/src/common/threadsafe_queue.h
index ad04df8ca..8430b9778 100644
--- a/src/common/threadsafe_queue.h
+++ b/src/common/threadsafe_queue.h
@@ -46,15 +46,13 @@ public:
46 ElementPtr* new_ptr = new ElementPtr(); 46 ElementPtr* new_ptr = new ElementPtr();
47 write_ptr->next.store(new_ptr, std::memory_order_release); 47 write_ptr->next.store(new_ptr, std::memory_order_release);
48 write_ptr = new_ptr; 48 write_ptr = new_ptr;
49 ++size;
49 50
50 const size_t previous_size{size++}; 51 // cv_mutex must be held or else there will be a missed wakeup if the other thread is in the
51 52 // line before cv.wait
52 // Acquire the mutex and then immediately release it as a fence.
53 // TODO(bunnei): This can be replaced with C++20 waitable atomics when properly supported. 53 // TODO(bunnei): This can be replaced with C++20 waitable atomics when properly supported.
54 // See discussion on https://github.com/yuzu-emu/yuzu/pull/3173 for details. 54 // See discussion on https://github.com/yuzu-emu/yuzu/pull/3173 for details.
55 if (previous_size == 0) { 55 std::lock_guard lock{cv_mutex};
56 std::lock_guard lock{cv_mutex};
57 }
58 cv.notify_one(); 56 cv.notify_one();
59 } 57 }
60 58
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp
index f1f950d8a..f102410d1 100644
--- a/src/input_common/sdl/sdl_impl.cpp
+++ b/src/input_common/sdl/sdl_impl.cpp
@@ -889,6 +889,9 @@ SDLState::SDLState() {
889 RegisterFactory<VibrationDevice>("sdl", vibration_factory); 889 RegisterFactory<VibrationDevice>("sdl", vibration_factory);
890 RegisterFactory<MotionDevice>("sdl", motion_factory); 890 RegisterFactory<MotionDevice>("sdl", motion_factory);
891 891
892 // Disable raw input. When enabled this setting causes SDL to die when a web applet opens
893 SDL_SetHint(SDL_HINT_JOYSTICK_RAWINPUT, "0");
894
892 // Enable HIDAPI rumble. This prevents SDL from disabling motion on PS4 and PS5 controllers 895 // Enable HIDAPI rumble. This prevents SDL from disabling motion on PS4 and PS5 controllers
893 SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1"); 896 SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1");
894 SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1"); 897 SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1");
diff --git a/src/video_core/command_classes/vic.cpp b/src/video_core/command_classes/vic.cpp
index d5e77941c..0ee07f398 100644
--- a/src/video_core/command_classes/vic.cpp
+++ b/src/video_core/command_classes/vic.cpp
@@ -96,12 +96,11 @@ void Vic::Execute() {
96 if (!converted_frame_buffer) { 96 if (!converted_frame_buffer) {
97 converted_frame_buffer = AVMallocPtr{static_cast<u8*>(av_malloc(linear_size)), av_free}; 97 converted_frame_buffer = AVMallocPtr{static_cast<u8*>(av_malloc(linear_size)), av_free};
98 } 98 }
99 99 const std::array<int, 4> converted_stride{frame->width * 4, frame->height * 4, 0, 0};
100 const int converted_stride{frame->width * 4};
101 u8* const converted_frame_buf_addr{converted_frame_buffer.get()}; 100 u8* const converted_frame_buf_addr{converted_frame_buffer.get()};
102 101
103 sws_scale(scaler_ctx, frame->data, frame->linesize, 0, frame->height, 102 sws_scale(scaler_ctx, frame->data, frame->linesize, 0, frame->height,
104 &converted_frame_buf_addr, &converted_stride); 103 &converted_frame_buf_addr, converted_stride.data());
105 104
106 const u32 blk_kind = static_cast<u32>(config.block_linear_kind); 105 const u32 blk_kind = static_cast<u32>(config.block_linear_kind);
107 if (blk_kind != 0) { 106 if (blk_kind != 0) {