summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/alignment.h21
-rw-r--r--src/common/div_ceil.h8
-rw-r--r--src/common/host_memory.cpp2
-rw-r--r--src/common/intrusive_red_black_tree.h17
-rw-r--r--src/common/uuid.h7
-rw-r--r--src/common/vector_math.h4
-rw-r--r--src/core/core.cpp2
-rw-r--r--src/core/file_sys/program_metadata.cpp2
-rw-r--r--src/core/frontend/applets/profile_select.cpp3
-rw-r--r--src/core/hle/kernel/k_handle_table.cpp2
-rw-r--r--src/core/hle/kernel/k_priority_queue.h27
-rw-r--r--src/core/hle/kernel/k_scheduler.h2
-rw-r--r--src/core/hle/kernel/k_scoped_lock.h15
-rw-r--r--src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h2
-rw-r--r--src/core/hle/service/acc/acc.cpp3
-rw-r--r--src/core/hle/service/acc/profile_manager.cpp9
-rw-r--r--src/core/hle/service/am/am.cpp4
-rw-r--r--src/core/hle/service/am/applets/applet_profile_select.cpp2
-rw-r--r--src/core/hle/service/audio/audctl.cpp8
-rw-r--r--src/core/hle/service/audio/audin_u.cpp79
-rw-r--r--src/core/hle/service/audio/audin_u.h14
-rw-r--r--src/core/hle/service/audio/audren_u.cpp3
-rw-r--r--src/core/hle/service/btdrv/btdrv.cpp4
-rw-r--r--src/core/hle/service/caps/caps_ss.cpp1
-rw-r--r--src/core/hle/service/es/es.cpp6
-rw-r--r--src/core/hle/service/hid/controllers/npad.h1
-rw-r--r--src/core/hle/service/hid/hid.cpp11
-rw-r--r--src/core/hle/service/npns/npns.cpp1
-rw-r--r--src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp2
-rw-r--r--src/core/hle/service/sockets/bsd.cpp14
-rw-r--r--src/core/hle/service/sockets/bsd.h1
-rw-r--r--src/core/hle/service/time/system_clock_core.cpp2
-rw-r--r--src/core/hle/service/time/time_zone_service.cpp4
-rw-r--r--src/core/hle/service/usb/usb.cpp6
-rw-r--r--src/core/hle/service/vi/vi.cpp1
-rw-r--r--src/input_common/main.cpp4
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp4
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp8
-rw-r--r--src/shader_recompiler/object_pool.h6
-rw-r--r--src/video_core/host_shaders/CMakeLists.txt1
-rw-r--r--src/video_core/host_shaders/opengl_copy_bgra.comp15
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp37
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.h22
-rw-r--r--src/video_core/renderer_opengl/maxwell_to_gl.h4
-rw-r--r--src/video_core/renderer_opengl/util_shaders.cpp76
-rw-r--r--src/video_core/renderer_opengl/util_shaders.h22
-rw-r--r--src/video_core/renderer_vulkan/renderer_vulkan.cpp15
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp5
-rw-r--r--src/video_core/renderer_vulkan/vk_scheduler.h2
-rw-r--r--src/video_core/renderer_vulkan/vk_swapchain.cpp29
-rw-r--r--src/video_core/renderer_vulkan/vk_swapchain.h11
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp2
-rw-r--r--src/video_core/texture_cache/slot_vector.h4
-rw-r--r--src/video_core/vulkan_common/vulkan_device.cpp25
-rw-r--r--src/video_core/vulkan_common/vulkan_device.h6
-rw-r--r--src/yuzu/configuration/config.cpp4
-rw-r--r--src/yuzu/configuration/configure_debug.ui181
-rw-r--r--src/yuzu/configuration/configure_input_advanced.cpp4
-rw-r--r--src/yuzu/configuration/configure_profile_manager.cpp2
-rw-r--r--src/yuzu/configuration/configure_tas.ui62
60 files changed, 422 insertions, 419 deletions
diff --git a/src/common/alignment.h b/src/common/alignment.h
index 32d796ffa..1b56569d1 100644
--- a/src/common/alignment.h
+++ b/src/common/alignment.h
@@ -9,41 +9,48 @@
9namespace Common { 9namespace Common {
10 10
11template <typename T> 11template <typename T>
12requires std::is_unsigned_v<T>[[nodiscard]] constexpr T AlignUp(T value, size_t size) { 12requires std::is_unsigned_v<T>
13[[nodiscard]] constexpr T AlignUp(T value, size_t size) {
13 auto mod{static_cast<T>(value % size)}; 14 auto mod{static_cast<T>(value % size)};
14 value -= mod; 15 value -= mod;
15 return static_cast<T>(mod == T{0} ? value : value + size); 16 return static_cast<T>(mod == T{0} ? value : value + size);
16} 17}
17 18
18template <typename T> 19template <typename T>
19requires std::is_unsigned_v<T>[[nodiscard]] constexpr T AlignUpLog2(T value, size_t align_log2) { 20requires std::is_unsigned_v<T>
21[[nodiscard]] constexpr T AlignUpLog2(T value, size_t align_log2) {
20 return static_cast<T>((value + ((1ULL << align_log2) - 1)) >> align_log2 << align_log2); 22 return static_cast<T>((value + ((1ULL << align_log2) - 1)) >> align_log2 << align_log2);
21} 23}
22 24
23template <typename T> 25template <typename T>
24requires std::is_unsigned_v<T>[[nodiscard]] constexpr T AlignDown(T value, size_t size) { 26requires std::is_unsigned_v<T>
27[[nodiscard]] constexpr T AlignDown(T value, size_t size) {
25 return static_cast<T>(value - value % size); 28 return static_cast<T>(value - value % size);
26} 29}
27 30
28template <typename T> 31template <typename T>
29requires std::is_unsigned_v<T>[[nodiscard]] constexpr bool Is4KBAligned(T value) { 32requires std::is_unsigned_v<T>
33[[nodiscard]] constexpr bool Is4KBAligned(T value) {
30 return (value & 0xFFF) == 0; 34 return (value & 0xFFF) == 0;
31} 35}
32 36
33template <typename T> 37template <typename T>
34requires std::is_unsigned_v<T>[[nodiscard]] constexpr bool IsWordAligned(T value) { 38requires std::is_unsigned_v<T>
39[[nodiscard]] constexpr bool IsWordAligned(T value) {
35 return (value & 0b11) == 0; 40 return (value & 0b11) == 0;
36} 41}
37 42
38template <typename T> 43template <typename T>
39requires std::is_integral_v<T>[[nodiscard]] constexpr bool IsAligned(T value, size_t alignment) { 44requires std::is_integral_v<T>
45[[nodiscard]] constexpr bool IsAligned(T value, size_t alignment) {
40 using U = typename std::make_unsigned_t<T>; 46 using U = typename std::make_unsigned_t<T>;
41 const U mask = static_cast<U>(alignment - 1); 47 const U mask = static_cast<U>(alignment - 1);
42 return (value & mask) == 0; 48 return (value & mask) == 0;
43} 49}
44 50
45template <typename T, typename U> 51template <typename T, typename U>
46requires std::is_integral_v<T>[[nodiscard]] constexpr T DivideUp(T x, U y) { 52requires std::is_integral_v<T>
53[[nodiscard]] constexpr T DivideUp(T x, U y) {
47 return (x + (y - 1)) / y; 54 return (x + (y - 1)) / y;
48} 55}
49 56
diff --git a/src/common/div_ceil.h b/src/common/div_ceil.h
index 95e1489a9..e1db35464 100644
--- a/src/common/div_ceil.h
+++ b/src/common/div_ceil.h
@@ -11,15 +11,15 @@ namespace Common {
11 11
12/// Ceiled integer division. 12/// Ceiled integer division.
13template <typename N, typename D> 13template <typename N, typename D>
14requires std::is_integral_v<N>&& std::is_unsigned_v<D>[[nodiscard]] constexpr N DivCeil(N number, 14requires std::is_integral_v<N> && std::is_unsigned_v<D>
15 D divisor) { 15[[nodiscard]] constexpr N DivCeil(N number, D divisor) {
16 return static_cast<N>((static_cast<D>(number) + divisor - 1) / divisor); 16 return static_cast<N>((static_cast<D>(number) + divisor - 1) / divisor);
17} 17}
18 18
19/// Ceiled integer division with logarithmic divisor in base 2 19/// Ceiled integer division with logarithmic divisor in base 2
20template <typename N, typename D> 20template <typename N, typename D>
21requires std::is_integral_v<N>&& std::is_unsigned_v<D>[[nodiscard]] constexpr N DivCeilLog2( 21requires std::is_integral_v<N> && std::is_unsigned_v<D>
22 N value, D alignment_log2) { 22[[nodiscard]] constexpr N DivCeilLog2(N value, D alignment_log2) {
23 return static_cast<N>((static_cast<D>(value) + (D(1) << alignment_log2) - 1) >> alignment_log2); 23 return static_cast<N>((static_cast<D>(value) + (D(1) << alignment_log2) - 1) >> alignment_log2);
24} 24}
25 25
diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp
index 6661244cf..b44a44949 100644
--- a/src/common/host_memory.cpp
+++ b/src/common/host_memory.cpp
@@ -314,8 +314,8 @@ private:
314 } 314 }
315 315
316 void UntrackPlaceholder(boost::icl::separate_interval_set<size_t>::iterator it) { 316 void UntrackPlaceholder(boost::icl::separate_interval_set<size_t>::iterator it) {
317 placeholders.erase(it);
318 placeholder_host_pointers.erase(it->lower()); 317 placeholder_host_pointers.erase(it->lower());
318 placeholders.erase(it);
319 } 319 }
320 320
321 /// Return true when a given memory region is a "nieche" and the placeholders don't have to be 321 /// Return true when a given memory region is a "nieche" and the placeholders don't have to be
diff --git a/src/common/intrusive_red_black_tree.h b/src/common/intrusive_red_black_tree.h
index 1f696fe80..3173cc449 100644
--- a/src/common/intrusive_red_black_tree.h
+++ b/src/common/intrusive_red_black_tree.h
@@ -235,20 +235,19 @@ public:
235 235
236template <typename T> 236template <typename T>
237concept HasLightCompareType = requires { 237concept HasLightCompareType = requires {
238 { std::is_same<typename T::LightCompareType, void>::value } 238 { std::is_same<typename T::LightCompareType, void>::value } -> std::convertible_to<bool>;
239 ->std::convertible_to<bool>;
240}; 239};
241 240
242namespace impl { 241namespace impl {
243 242
244template <typename T, typename Default> 243 template <typename T, typename Default>
245consteval auto* GetLightCompareType() { 244 consteval auto* GetLightCompareType() {
246 if constexpr (HasLightCompareType<T>) { 245 if constexpr (HasLightCompareType<T>) {
247 return static_cast<typename T::LightCompareType*>(nullptr); 246 return static_cast<typename T::LightCompareType*>(nullptr);
248 } else { 247 } else {
249 return static_cast<Default*>(nullptr); 248 return static_cast<Default*>(nullptr);
249 }
250 } 250 }
251}
252 251
253} // namespace impl 252} // namespace impl
254 253
diff --git a/src/common/uuid.h b/src/common/uuid.h
index 2353179d8..8ea01f8da 100644
--- a/src/common/uuid.h
+++ b/src/common/uuid.h
@@ -58,6 +58,13 @@ struct UUID {
58 uuid = INVALID_UUID; 58 uuid = INVALID_UUID;
59 } 59 }
60 60
61 [[nodiscard]] constexpr bool IsInvalid() const {
62 return uuid == INVALID_UUID;
63 }
64 [[nodiscard]] constexpr bool IsValid() const {
65 return !IsInvalid();
66 }
67
61 // TODO(ogniK): Properly generate a Nintendo ID 68 // TODO(ogniK): Properly generate a Nintendo ID
62 [[nodiscard]] constexpr u64 GetNintendoID() const { 69 [[nodiscard]] constexpr u64 GetNintendoID() const {
63 return uuid[0]; 70 return uuid[0];
diff --git a/src/common/vector_math.h b/src/common/vector_math.h
index 22dba3c2d..ba7c363c1 100644
--- a/src/common/vector_math.h
+++ b/src/common/vector_math.h
@@ -667,8 +667,8 @@ template <typename T>
667 667
668// linear interpolation via float: 0.0=begin, 1.0=end 668// linear interpolation via float: 0.0=begin, 1.0=end
669template <typename X> 669template <typename X>
670[[nodiscard]] constexpr decltype(X{} * float{} + X{} * float{}) Lerp(const X& begin, const X& end, 670[[nodiscard]] constexpr decltype(X{} * float{} + X{} * float{})
671 const float t) { 671 Lerp(const X& begin, const X& end, const float t) {
672 return begin * (1.f - t) + end * t; 672 return begin * (1.f - t) + end * t;
673} 673}
674 674
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 54ebed2c1..50d5dab4b 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -305,7 +305,6 @@ struct System::Impl {
305 is_powered_on = false; 305 is_powered_on = false;
306 exit_lock = false; 306 exit_lock = false;
307 307
308 gpu_core.reset();
309 services.reset(); 308 services.reset();
310 service_manager.reset(); 309 service_manager.reset();
311 cheat_engine.reset(); 310 cheat_engine.reset();
@@ -315,6 +314,7 @@ struct System::Impl {
315 core_timing.Shutdown(); 314 core_timing.Shutdown();
316 app_loader.reset(); 315 app_loader.reset();
317 perf_stats.reset(); 316 perf_stats.reset();
317 gpu_core.reset();
318 kernel.Shutdown(); 318 kernel.Shutdown();
319 memory.Reset(); 319 memory.Reset();
320 applet_manager.ClearAll(); 320 applet_manager.ClearAll();
diff --git a/src/core/file_sys/program_metadata.cpp b/src/core/file_sys/program_metadata.cpp
index 01ae1a567..35a53d36c 100644
--- a/src/core/file_sys/program_metadata.cpp
+++ b/src/core/file_sys/program_metadata.cpp
@@ -77,7 +77,7 @@ void ProgramMetadata::LoadManual(bool is_64_bit, ProgramAddressSpaceType address
77 aci_header.title_id = title_id; 77 aci_header.title_id = title_id;
78 aci_file_access.permissions = filesystem_permissions; 78 aci_file_access.permissions = filesystem_permissions;
79 npdm_header.system_resource_size = system_resource_size; 79 npdm_header.system_resource_size = system_resource_size;
80 aci_kernel_capabilities = std ::move(capabilities); 80 aci_kernel_capabilities = std::move(capabilities);
81} 81}
82 82
83bool ProgramMetadata::Is64BitProgram() const { 83bool ProgramMetadata::Is64BitProgram() const {
diff --git a/src/core/frontend/applets/profile_select.cpp b/src/core/frontend/applets/profile_select.cpp
index 4c58c310f..3e4f90be2 100644
--- a/src/core/frontend/applets/profile_select.cpp
+++ b/src/core/frontend/applets/profile_select.cpp
@@ -13,7 +13,8 @@ ProfileSelectApplet::~ProfileSelectApplet() = default;
13void DefaultProfileSelectApplet::SelectProfile( 13void DefaultProfileSelectApplet::SelectProfile(
14 std::function<void(std::optional<Common::UUID>)> callback) const { 14 std::function<void(std::optional<Common::UUID>)> callback) const {
15 Service::Account::ProfileManager manager; 15 Service::Account::ProfileManager manager;
16 callback(manager.GetUser(Settings::values.current_user.GetValue()).value_or(Common::UUID{})); 16 callback(manager.GetUser(Settings::values.current_user.GetValue())
17 .value_or(Common::UUID{Common::INVALID_UUID}));
17 LOG_INFO(Service_ACC, "called, selecting current user instead of prompting..."); 18 LOG_INFO(Service_ACC, "called, selecting current user instead of prompting...");
18} 19}
19 20
diff --git a/src/core/hle/kernel/k_handle_table.cpp b/src/core/hle/kernel/k_handle_table.cpp
index 6a420d5b0..44d13169f 100644
--- a/src/core/hle/kernel/k_handle_table.cpp
+++ b/src/core/hle/kernel/k_handle_table.cpp
@@ -7,7 +7,7 @@
7namespace Kernel { 7namespace Kernel {
8 8
9KHandleTable::KHandleTable(KernelCore& kernel_) : kernel{kernel_} {} 9KHandleTable::KHandleTable(KernelCore& kernel_) : kernel{kernel_} {}
10KHandleTable ::~KHandleTable() = default; 10KHandleTable::~KHandleTable() = default;
11 11
12ResultCode KHandleTable::Finalize() { 12ResultCode KHandleTable::Finalize() {
13 // Get the table and clear our record of it. 13 // Get the table and clear our record of it.
diff --git a/src/core/hle/kernel/k_priority_queue.h b/src/core/hle/kernel/k_priority_queue.h
index 4aa669d95..f4d71ad7e 100644
--- a/src/core/hle/kernel/k_priority_queue.h
+++ b/src/core/hle/kernel/k_priority_queue.h
@@ -22,12 +22,10 @@ class KThread;
22 22
23template <typename T> 23template <typename T>
24concept KPriorityQueueAffinityMask = !std::is_reference_v<T> && requires(T & t) { 24concept KPriorityQueueAffinityMask = !std::is_reference_v<T> && requires(T & t) {
25 { t.GetAffinityMask() } 25 { t.GetAffinityMask() } -> Common::ConvertibleTo<u64>;
26 ->Common::ConvertibleTo<u64>;
27 {t.SetAffinityMask(0)}; 26 {t.SetAffinityMask(0)};
28 27
29 { t.GetAffinity(0) } 28 { t.GetAffinity(0) } -> std::same_as<bool>;
30 ->std::same_as<bool>;
31 {t.SetAffinity(0, false)}; 29 {t.SetAffinity(0, false)};
32 {t.SetAll()}; 30 {t.SetAll()};
33}; 31};
@@ -38,25 +36,20 @@ concept KPriorityQueueMember = !std::is_reference_v<T> && requires(T & t) {
38 {(typename T::QueueEntry()).Initialize()}; 36 {(typename T::QueueEntry()).Initialize()};
39 {(typename T::QueueEntry()).SetPrev(std::addressof(t))}; 37 {(typename T::QueueEntry()).SetPrev(std::addressof(t))};
40 {(typename T::QueueEntry()).SetNext(std::addressof(t))}; 38 {(typename T::QueueEntry()).SetNext(std::addressof(t))};
41 { (typename T::QueueEntry()).GetNext() } 39 { (typename T::QueueEntry()).GetNext() } -> std::same_as<T*>;
42 ->std::same_as<T*>; 40 { (typename T::QueueEntry()).GetPrev() } -> std::same_as<T*>;
43 { (typename T::QueueEntry()).GetPrev() } 41 { t.GetPriorityQueueEntry(0) } -> std::same_as<typename T::QueueEntry&>;
44 ->std::same_as<T*>;
45 { t.GetPriorityQueueEntry(0) }
46 ->std::same_as<typename T::QueueEntry&>;
47 42
48 {t.GetAffinityMask()}; 43 {t.GetAffinityMask()};
49 { std::remove_cvref_t<decltype(t.GetAffinityMask())>() } 44 { std::remove_cvref_t<decltype(t.GetAffinityMask())>() } -> KPriorityQueueAffinityMask;
50 ->KPriorityQueueAffinityMask;
51 45
52 { t.GetActiveCore() } 46 { t.GetActiveCore() } -> Common::ConvertibleTo<s32>;
53 ->Common::ConvertibleTo<s32>; 47 { t.GetPriority() } -> Common::ConvertibleTo<s32>;
54 { t.GetPriority() }
55 ->Common::ConvertibleTo<s32>;
56}; 48};
57 49
58template <typename Member, size_t NumCores_, int LowestPriority, int HighestPriority> 50template <typename Member, size_t NumCores_, int LowestPriority, int HighestPriority>
59requires KPriorityQueueMember<Member> class KPriorityQueue { 51requires KPriorityQueueMember<Member>
52class KPriorityQueue {
60public: 53public:
61 using AffinityMaskType = std::remove_cv_t< 54 using AffinityMaskType = std::remove_cv_t<
62 std::remove_reference_t<decltype(std::declval<Member>().GetAffinityMask())>>; 55 std::remove_reference_t<decltype(std::declval<Member>().GetAffinityMask())>>;
diff --git a/src/core/hle/kernel/k_scheduler.h b/src/core/hle/kernel/k_scheduler.h
index 12cfae919..c8ccc1ae4 100644
--- a/src/core/hle/kernel/k_scheduler.h
+++ b/src/core/hle/kernel/k_scheduler.h
@@ -197,7 +197,7 @@ private:
197 197
198class [[nodiscard]] KScopedSchedulerLock : KScopedLock<GlobalSchedulerContext::LockType> { 198class [[nodiscard]] KScopedSchedulerLock : KScopedLock<GlobalSchedulerContext::LockType> {
199public: 199public:
200 explicit KScopedSchedulerLock(KernelCore & kernel); 200 explicit KScopedSchedulerLock(KernelCore& kernel);
201 ~KScopedSchedulerLock(); 201 ~KScopedSchedulerLock();
202}; 202};
203 203
diff --git a/src/core/hle/kernel/k_scoped_lock.h b/src/core/hle/kernel/k_scoped_lock.h
index 72c3b0252..4fb180fc6 100644
--- a/src/core/hle/kernel/k_scoped_lock.h
+++ b/src/core/hle/kernel/k_scoped_lock.h
@@ -13,19 +13,18 @@ namespace Kernel {
13 13
14template <typename T> 14template <typename T>
15concept KLockable = !std::is_reference_v<T> && requires(T & t) { 15concept KLockable = !std::is_reference_v<T> && requires(T & t) {
16 { t.Lock() } 16 { t.Lock() } -> std::same_as<void>;
17 ->std::same_as<void>; 17 { t.Unlock() } -> std::same_as<void>;
18 { t.Unlock() }
19 ->std::same_as<void>;
20}; 18};
21 19
22template <typename T> 20template <typename T>
23requires KLockable<T> class [[nodiscard]] KScopedLock { 21requires KLockable<T>
22class [[nodiscard]] KScopedLock {
24public: 23public:
25 explicit KScopedLock(T * l) : lock_ptr(l) { 24 explicit KScopedLock(T* l) : lock_ptr(l) {
26 this->lock_ptr->Lock(); 25 this->lock_ptr->Lock();
27 } 26 }
28 explicit KScopedLock(T & l) : KScopedLock(std::addressof(l)) {} 27 explicit KScopedLock(T& l) : KScopedLock(std::addressof(l)) {}
29 28
30 ~KScopedLock() { 29 ~KScopedLock() {
31 this->lock_ptr->Unlock(); 30 this->lock_ptr->Unlock();
@@ -34,7 +33,7 @@ public:
34 KScopedLock(const KScopedLock&) = delete; 33 KScopedLock(const KScopedLock&) = delete;
35 KScopedLock& operator=(const KScopedLock&) = delete; 34 KScopedLock& operator=(const KScopedLock&) = delete;
36 35
37 KScopedLock(KScopedLock &&) = delete; 36 KScopedLock(KScopedLock&&) = delete;
38 KScopedLock& operator=(KScopedLock&&) = delete; 37 KScopedLock& operator=(KScopedLock&&) = delete;
39 38
40private: 39private:
diff --git a/src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h b/src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h
index a86af56dd..f6c75f2d9 100644
--- a/src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h
+++ b/src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h
@@ -17,7 +17,7 @@ namespace Kernel {
17 17
18class [[nodiscard]] KScopedSchedulerLockAndSleep { 18class [[nodiscard]] KScopedSchedulerLockAndSleep {
19public: 19public:
20 explicit KScopedSchedulerLockAndSleep(KernelCore & kernel_, KThread * t, s64 timeout) 20 explicit KScopedSchedulerLockAndSleep(KernelCore& kernel_, KThread* t, s64 timeout)
21 : kernel(kernel_), thread(t), timeout_tick(timeout) { 21 : kernel(kernel_), thread(t), timeout_tick(timeout) {
22 // Lock the scheduler. 22 // Lock the scheduler.
23 kernel.GlobalSchedulerContext().scheduler_lock.Lock(); 23 kernel.GlobalSchedulerContext().scheduler_lock.Lock();
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index 6d9ec0a8a..689b36056 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -929,8 +929,7 @@ void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContex
929 } 929 }
930 930
931 const auto user_list = profile_manager->GetAllUsers(); 931 const auto user_list = profile_manager->GetAllUsers();
932 if (std::all_of(user_list.begin(), user_list.end(), 932 if (std::ranges::all_of(user_list, [](const auto& user) { return user.IsInvalid(); })) {
933 [](const auto& user) { return user.uuid == Common::INVALID_UUID; })) {
934 rb.Push(ResultUnknown); // TODO(ogniK): Find the correct error code 933 rb.Push(ResultUnknown); // TODO(ogniK): Find the correct error code
935 rb.PushRaw<u128>(Common::INVALID_UUID); 934 rb.PushRaw<u128>(Common::INVALID_UUID);
936 return; 935 return;
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp
index 24a1c9157..568303ced 100644
--- a/src/core/hle/service/acc/profile_manager.cpp
+++ b/src/core/hle/service/acc/profile_manager.cpp
@@ -208,9 +208,10 @@ bool ProfileManager::UserExists(UUID uuid) const {
208} 208}
209 209
210bool ProfileManager::UserExistsIndex(std::size_t index) const { 210bool ProfileManager::UserExistsIndex(std::size_t index) const {
211 if (index >= MAX_USERS) 211 if (index >= MAX_USERS) {
212 return false; 212 return false;
213 return profiles[index].user_uuid.uuid != Common::INVALID_UUID; 213 }
214 return profiles[index].user_uuid.IsValid();
214} 215}
215 216
216/// Opens a specific user 217/// Opens a specific user
@@ -304,7 +305,7 @@ bool ProfileManager::RemoveUser(UUID uuid) {
304 305
305bool ProfileManager::SetProfileBase(UUID uuid, const ProfileBase& profile_new) { 306bool ProfileManager::SetProfileBase(UUID uuid, const ProfileBase& profile_new) {
306 const auto index = GetUserIndex(uuid); 307 const auto index = GetUserIndex(uuid);
307 if (!index || profile_new.user_uuid == UUID(Common::INVALID_UUID)) { 308 if (!index || profile_new.user_uuid.IsInvalid()) {
308 return false; 309 return false;
309 } 310 }
310 311
@@ -346,7 +347,7 @@ void ProfileManager::ParseUserSaveFile() {
346 } 347 }
347 348
348 for (const auto& user : data.users) { 349 for (const auto& user : data.users) {
349 if (user.uuid == UUID(Common::INVALID_UUID)) { 350 if (user.uuid.IsInvalid()) {
350 continue; 351 continue;
351 } 352 }
352 353
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index c3ac73131..8c2e2f920 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -275,12 +275,14 @@ ISelfController::ISelfController(Core::System& system_, NVFlinger::NVFlinger& nv
275 {18, nullptr, "SetRequiresCaptureButtonShortPressedMessage"}, 275 {18, nullptr, "SetRequiresCaptureButtonShortPressedMessage"},
276 {19, &ISelfController::SetAlbumImageOrientation, "SetAlbumImageOrientation"}, 276 {19, &ISelfController::SetAlbumImageOrientation, "SetAlbumImageOrientation"},
277 {20, nullptr, "SetDesirableKeyboardLayout"}, 277 {20, nullptr, "SetDesirableKeyboardLayout"},
278 {21, nullptr, "GetScreenShotProgramId"},
278 {40, &ISelfController::CreateManagedDisplayLayer, "CreateManagedDisplayLayer"}, 279 {40, &ISelfController::CreateManagedDisplayLayer, "CreateManagedDisplayLayer"},
279 {41, nullptr, "IsSystemBufferSharingEnabled"}, 280 {41, nullptr, "IsSystemBufferSharingEnabled"},
280 {42, nullptr, "GetSystemSharedLayerHandle"}, 281 {42, nullptr, "GetSystemSharedLayerHandle"},
281 {43, nullptr, "GetSystemSharedBufferHandle"}, 282 {43, nullptr, "GetSystemSharedBufferHandle"},
282 {44, &ISelfController::CreateManagedDisplaySeparableLayer, "CreateManagedDisplaySeparableLayer"}, 283 {44, &ISelfController::CreateManagedDisplaySeparableLayer, "CreateManagedDisplaySeparableLayer"},
283 {45, nullptr, "SetManagedDisplayLayerSeparationMode"}, 284 {45, nullptr, "SetManagedDisplayLayerSeparationMode"},
285 {46, nullptr, "SetRecordingLayerCompositionEnabled"},
284 {50, &ISelfController::SetHandlesRequestToDisplay, "SetHandlesRequestToDisplay"}, 286 {50, &ISelfController::SetHandlesRequestToDisplay, "SetHandlesRequestToDisplay"},
285 {51, nullptr, "ApproveToDisplay"}, 287 {51, nullptr, "ApproveToDisplay"},
286 {60, nullptr, "OverrideAutoSleepTimeAndDimmingTime"}, 288 {60, nullptr, "OverrideAutoSleepTimeAndDimmingTime"},
@@ -302,6 +304,7 @@ ISelfController::ISelfController(Core::System& system_, NVFlinger::NVFlinger& nv
302 {100, &ISelfController::SetAlbumImageTakenNotificationEnabled, "SetAlbumImageTakenNotificationEnabled"}, 304 {100, &ISelfController::SetAlbumImageTakenNotificationEnabled, "SetAlbumImageTakenNotificationEnabled"},
303 {110, nullptr, "SetApplicationAlbumUserData"}, 305 {110, nullptr, "SetApplicationAlbumUserData"},
304 {120, nullptr, "SaveCurrentScreenshot"}, 306 {120, nullptr, "SaveCurrentScreenshot"},
307 {130, nullptr, "SetRecordVolumeMuted"},
305 {1000, nullptr, "GetDebugStorageChannel"}, 308 {1000, nullptr, "GetDebugStorageChannel"},
306 }; 309 };
307 // clang-format on 310 // clang-format on
@@ -683,6 +686,7 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system_,
683 {91, nullptr, "GetCurrentPerformanceConfiguration"}, 686 {91, nullptr, "GetCurrentPerformanceConfiguration"},
684 {100, nullptr, "SetHandlingHomeButtonShortPressedEnabled"}, 687 {100, nullptr, "SetHandlingHomeButtonShortPressedEnabled"},
685 {110, nullptr, "OpenMyGpuErrorHandler"}, 688 {110, nullptr, "OpenMyGpuErrorHandler"},
689 {120, nullptr, "GetAppletLaunchedHistory"},
686 {200, nullptr, "GetOperationModeSystemInfo"}, 690 {200, nullptr, "GetOperationModeSystemInfo"},
687 {300, nullptr, "GetSettingsPlatformRegion"}, 691 {300, nullptr, "GetSettingsPlatformRegion"},
688 {400, nullptr, "ActivateMigrationService"}, 692 {400, nullptr, "ActivateMigrationService"},
diff --git a/src/core/hle/service/am/applets/applet_profile_select.cpp b/src/core/hle/service/am/applets/applet_profile_select.cpp
index bdc21778e..a6e891944 100644
--- a/src/core/hle/service/am/applets/applet_profile_select.cpp
+++ b/src/core/hle/service/am/applets/applet_profile_select.cpp
@@ -60,7 +60,7 @@ void ProfileSelect::Execute() {
60void ProfileSelect::SelectionComplete(std::optional<Common::UUID> uuid) { 60void ProfileSelect::SelectionComplete(std::optional<Common::UUID> uuid) {
61 UserSelectionOutput output{}; 61 UserSelectionOutput output{};
62 62
63 if (uuid.has_value() && uuid->uuid != Common::INVALID_UUID) { 63 if (uuid.has_value() && uuid->IsValid()) {
64 output.result = 0; 64 output.result = 0;
65 output.uuid_selected = uuid->uuid; 65 output.uuid_selected = uuid->uuid;
66 } else { 66 } else {
diff --git a/src/core/hle/service/audio/audctl.cpp b/src/core/hle/service/audio/audctl.cpp
index 8c4c49b85..2e46e7161 100644
--- a/src/core/hle/service/audio/audctl.cpp
+++ b/src/core/hle/service/audio/audctl.cpp
@@ -41,6 +41,14 @@ AudCtl::AudCtl(Core::System& system_) : ServiceFramework{system_, "audctl"} {
41 {27, nullptr, "SetVolumeMappingTableForDev"}, 41 {27, nullptr, "SetVolumeMappingTableForDev"},
42 {28, nullptr, "GetAudioOutputChannelCountForPlayReport"}, 42 {28, nullptr, "GetAudioOutputChannelCountForPlayReport"},
43 {29, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"}, 43 {29, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"},
44 {30, nullptr, "Unknown30"},
45 {31, nullptr, "Unknown31"},
46 {32, nullptr, "Unknown32"},
47 {33, nullptr, "Unknown33"},
48 {34, nullptr, "Unknown34"},
49 {10000, nullptr, "Unknown10000"},
50 {10001, nullptr, "Unknown10001"},
51 {10002, nullptr, "Unknown10002"},
44 }; 52 };
45 // clang-format on 53 // clang-format on
46 54
diff --git a/src/core/hle/service/audio/audin_u.cpp b/src/core/hle/service/audio/audin_u.cpp
index 3e7fd6024..570525019 100644
--- a/src/core/hle/service/audio/audin_u.cpp
+++ b/src/core/hle/service/audio/audin_u.cpp
@@ -3,38 +3,65 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "common/logging/log.h" 5#include "common/logging/log.h"
6#include "core/core.h"
6#include "core/hle/ipc_helpers.h" 7#include "core/hle/ipc_helpers.h"
7#include "core/hle/kernel/hle_ipc.h" 8#include "core/hle/kernel/hle_ipc.h"
9#include "core/hle/kernel/k_event.h"
8#include "core/hle/service/audio/audin_u.h" 10#include "core/hle/service/audio/audin_u.h"
9 11
10namespace Service::Audio { 12namespace Service::Audio {
11 13
12class IAudioIn final : public ServiceFramework<IAudioIn> { 14IAudioIn::IAudioIn(Core::System& system_)
13public: 15 : ServiceFramework{system_, "IAudioIn"}, buffer_event{system_.Kernel()} {
14 explicit IAudioIn(Core::System& system_) : ServiceFramework{system_, "IAudioIn"} { 16 // clang-format off
15 // clang-format off 17 static const FunctionInfo functions[] = {
16 static const FunctionInfo functions[] = { 18 {0, nullptr, "GetAudioInState"},
17 {0, nullptr, "GetAudioInState"}, 19 {1, &IAudioIn::Start, "Start"},
18 {1, nullptr, "Start"}, 20 {2, nullptr, "Stop"},
19 {2, nullptr, "Stop"}, 21 {3, nullptr, "AppendAudioInBuffer"},
20 {3, nullptr, "AppendAudioInBuffer"}, 22 {4, &IAudioIn::RegisterBufferEvent, "RegisterBufferEvent"},
21 {4, nullptr, "RegisterBufferEvent"}, 23 {5, nullptr, "GetReleasedAudioInBuffer"},
22 {5, nullptr, "GetReleasedAudioInBuffer"}, 24 {6, nullptr, "ContainsAudioInBuffer"},
23 {6, nullptr, "ContainsAudioInBuffer"}, 25 {7, nullptr, "AppendUacInBuffer"},
24 {7, nullptr, "AppendUacInBuffer"}, 26 {8, &IAudioIn::AppendAudioInBufferAuto, "AppendAudioInBufferAuto"},
25 {8, nullptr, "AppendAudioInBufferAuto"}, 27 {9, nullptr, "GetReleasedAudioInBuffersAuto"},
26 {9, nullptr, "GetReleasedAudioInBuffersAuto"}, 28 {10, nullptr, "AppendUacInBufferAuto"},
27 {10, nullptr, "AppendUacInBufferAuto"}, 29 {11, nullptr, "GetAudioInBufferCount"},
28 {11, nullptr, "GetAudioInBufferCount"}, 30 {12, nullptr, "SetDeviceGain"},
29 {12, nullptr, "SetDeviceGain"}, 31 {13, nullptr, "GetDeviceGain"},
30 {13, nullptr, "GetDeviceGain"}, 32 {14, nullptr, "FlushAudioInBuffers"},
31 {14, nullptr, "FlushAudioInBuffers"}, 33 };
32 }; 34 // clang-format on
33 // clang-format on 35
34 36 RegisterHandlers(functions);
35 RegisterHandlers(functions); 37
36 } 38 Kernel::KAutoObject::Create(std::addressof(buffer_event));
37}; 39 buffer_event.Initialize("IAudioIn:BufferEvent");
40}
41
42IAudioIn::~IAudioIn() = default;
43
44void IAudioIn::Start(Kernel::HLERequestContext& ctx) {
45 LOG_WARNING(Service_Audio, "(STUBBED) called");
46
47 IPC::ResponseBuilder rb{ctx, 2};
48 rb.Push(ResultSuccess);
49}
50
51void IAudioIn::RegisterBufferEvent(Kernel::HLERequestContext& ctx) {
52 LOG_WARNING(Service_Audio, "(STUBBED) called");
53
54 IPC::ResponseBuilder rb{ctx, 2, 1};
55 rb.Push(ResultSuccess);
56 rb.PushCopyObjects(buffer_event.GetReadableEvent());
57}
58
59void IAudioIn::AppendAudioInBufferAuto(Kernel::HLERequestContext& ctx) {
60 LOG_WARNING(Service_Audio, "(STUBBED) called");
61
62 IPC::ResponseBuilder rb{ctx, 2};
63 rb.Push(ResultSuccess);
64}
38 65
39AudInU::AudInU(Core::System& system_) : ServiceFramework{system_, "audin:u"} { 66AudInU::AudInU(Core::System& system_) : ServiceFramework{system_, "audin:u"} {
40 // clang-format off 67 // clang-format off
diff --git a/src/core/hle/service/audio/audin_u.h b/src/core/hle/service/audio/audin_u.h
index 0d75ae5ac..f2f7f9932 100644
--- a/src/core/hle/service/audio/audin_u.h
+++ b/src/core/hle/service/audio/audin_u.h
@@ -4,6 +4,7 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "core/hle/kernel/k_event.h"
7#include "core/hle/service/service.h" 8#include "core/hle/service/service.h"
8 9
9namespace Core { 10namespace Core {
@@ -16,6 +17,19 @@ class HLERequestContext;
16 17
17namespace Service::Audio { 18namespace Service::Audio {
18 19
20class IAudioIn final : public ServiceFramework<IAudioIn> {
21public:
22 explicit IAudioIn(Core::System& system_);
23 ~IAudioIn() override;
24
25private:
26 void Start(Kernel::HLERequestContext& ctx);
27 void RegisterBufferEvent(Kernel::HLERequestContext& ctx);
28 void AppendAudioInBufferAuto(Kernel::HLERequestContext& ctx);
29
30 Kernel::KEvent buffer_event;
31};
32
19class AudInU final : public ServiceFramework<AudInU> { 33class AudInU final : public ServiceFramework<AudInU> {
20public: 34public:
21 explicit AudInU(Core::System& system_); 35 explicit AudInU(Core::System& system_);
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index b769fe959..1a91719f5 100644
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -187,7 +187,8 @@ public:
187 {10, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceNameAuto"}, 187 {10, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceNameAuto"},
188 {11, &IAudioDevice::QueryAudioDeviceInputEvent, "QueryAudioDeviceInputEvent"}, 188 {11, &IAudioDevice::QueryAudioDeviceInputEvent, "QueryAudioDeviceInputEvent"},
189 {12, &IAudioDevice::QueryAudioDeviceOutputEvent, "QueryAudioDeviceOutputEvent"}, 189 {12, &IAudioDevice::QueryAudioDeviceOutputEvent, "QueryAudioDeviceOutputEvent"},
190 {13, nullptr, "GetAudioSystemMasterVolumeSetting"}, 190 {13, nullptr, "GetActiveAudioOutputDeviceName"},
191 {14, nullptr, "ListAudioOutputDeviceName"},
191 }; 192 };
192 RegisterHandlers(functions); 193 RegisterHandlers(functions);
193 } 194 }
diff --git a/src/core/hle/service/btdrv/btdrv.cpp b/src/core/hle/service/btdrv/btdrv.cpp
index 46da438ef..acf791de2 100644
--- a/src/core/hle/service/btdrv/btdrv.cpp
+++ b/src/core/hle/service/btdrv/btdrv.cpp
@@ -175,6 +175,10 @@ public:
175 {143, nullptr, "GetAudioControlInputState"}, 175 {143, nullptr, "GetAudioControlInputState"},
176 {144, nullptr, "AcquireAudioConnectionStateChangedEvent"}, 176 {144, nullptr, "AcquireAudioConnectionStateChangedEvent"},
177 {145, nullptr, "GetConnectedAudioDevice"}, 177 {145, nullptr, "GetConnectedAudioDevice"},
178 {146, nullptr, "CloseAudioControlInput"},
179 {147, nullptr, "RegisterAudioControlNotification"},
180 {148, nullptr, "SendAudioControlPassthroughCommand"},
181 {149, nullptr, "SendAudioControlSetAbsoluteVolumeCommand"},
178 {256, nullptr, "IsManufacturingMode"}, 182 {256, nullptr, "IsManufacturingMode"},
179 {257, nullptr, "EmulateBluetoothCrash"}, 183 {257, nullptr, "EmulateBluetoothCrash"},
180 {258, nullptr, "GetBleChannelMap"}, 184 {258, nullptr, "GetBleChannelMap"},
diff --git a/src/core/hle/service/caps/caps_ss.cpp b/src/core/hle/service/caps/caps_ss.cpp
index 2b5314691..33a976ddf 100644
--- a/src/core/hle/service/caps/caps_ss.cpp
+++ b/src/core/hle/service/caps/caps_ss.cpp
@@ -15,6 +15,7 @@ CAPS_SS::CAPS_SS(Core::System& system_) : ServiceFramework{system_, "caps:ss"} {
15 {204, nullptr, "SaveEditedScreenShotEx0"}, 15 {204, nullptr, "SaveEditedScreenShotEx0"},
16 {206, nullptr, "Unknown206"}, 16 {206, nullptr, "Unknown206"},
17 {208, nullptr, "SaveScreenShotOfMovieEx1"}, 17 {208, nullptr, "SaveScreenShotOfMovieEx1"},
18 {1000, nullptr, "Unknown1000"},
18 }; 19 };
19 // clang-format on 20 // clang-format on
20 21
diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp
index 110c7cb1c..f6184acc9 100644
--- a/src/core/hle/service/es/es.cpp
+++ b/src/core/hle/service/es/es.cpp
@@ -55,6 +55,8 @@ public:
55 {36, nullptr, "DeleteAllInactiveELicenseRequiredPersonalizedTicket"}, 55 {36, nullptr, "DeleteAllInactiveELicenseRequiredPersonalizedTicket"},
56 {37, nullptr, "OwnTicket2"}, 56 {37, nullptr, "OwnTicket2"},
57 {38, nullptr, "OwnTicket3"}, 57 {38, nullptr, "OwnTicket3"},
58 {39, nullptr, "DeleteAllInactivePersonalizedTicket"},
59 {40, nullptr, "DeletePrepurchaseRecordByNintendoAccountId"},
58 {501, nullptr, "Unknown501"}, 60 {501, nullptr, "Unknown501"},
59 {502, nullptr, "Unknown502"}, 61 {502, nullptr, "Unknown502"},
60 {503, nullptr, "GetTitleKey"}, 62 {503, nullptr, "GetTitleKey"},
@@ -88,11 +90,15 @@ public:
88 {1503, nullptr, "Unknown1503"}, 90 {1503, nullptr, "Unknown1503"},
89 {1504, nullptr, "Unknown1504"}, 91 {1504, nullptr, "Unknown1504"},
90 {1505, nullptr, "Unknown1505"}, 92 {1505, nullptr, "Unknown1505"},
93 {1506, nullptr, "Unknown1506"},
91 {2000, nullptr, "Unknown2000"}, 94 {2000, nullptr, "Unknown2000"},
92 {2001, nullptr, "Unknown2001"}, 95 {2001, nullptr, "Unknown2001"},
96 {2002, nullptr, "Unknown2002"},
97 {2003, nullptr, "Unknown2003"},
93 {2100, nullptr, "Unknown2100"}, 98 {2100, nullptr, "Unknown2100"},
94 {2501, nullptr, "Unknown2501"}, 99 {2501, nullptr, "Unknown2501"},
95 {2502, nullptr, "Unknown2502"}, 100 {2502, nullptr, "Unknown2502"},
101 {2601, nullptr, "Unknown2601"},
96 {3001, nullptr, "Unknown3001"}, 102 {3001, nullptr, "Unknown3001"},
97 {3002, nullptr, "Unknown3002"}, 103 {3002, nullptr, "Unknown3002"},
98 }; 104 };
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h
index 4fcc6f93a..9ee146caf 100644
--- a/src/core/hle/service/hid/controllers/npad.h
+++ b/src/core/hle/service/hid/controllers/npad.h
@@ -507,6 +507,7 @@ private:
507 LarkNesRight = 18, 507 LarkNesRight = 18,
508 Lucia = 19, 508 Lucia = 19,
509 Verification = 20, 509 Verification = 20,
510 Lagon = 21,
510 }; 511 };
511 512
512 struct NPadEntry { 513 struct NPadEntry {
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index a1707a72a..8c363142c 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -106,7 +106,7 @@ void IAppletResource::DeactivateController(HidController controller) {
106 controllers[static_cast<size_t>(controller)]->DeactivateController(); 106 controllers[static_cast<size_t>(controller)]->DeactivateController();
107} 107}
108 108
109IAppletResource ::~IAppletResource() { 109IAppletResource::~IAppletResource() {
110 system.CoreTiming().UnscheduleEvent(pad_update_event, 0); 110 system.CoreTiming().UnscheduleEvent(pad_update_event, 0);
111 system.CoreTiming().UnscheduleEvent(motion_update_event, 0); 111 system.CoreTiming().UnscheduleEvent(motion_update_event, 0);
112} 112}
@@ -239,6 +239,12 @@ Hid::Hid(Core::System& system_)
239 {81, &Hid::ResetGyroscopeZeroDriftMode, "ResetGyroscopeZeroDriftMode"}, 239 {81, &Hid::ResetGyroscopeZeroDriftMode, "ResetGyroscopeZeroDriftMode"},
240 {82, &Hid::IsSixAxisSensorAtRest, "IsSixAxisSensorAtRest"}, 240 {82, &Hid::IsSixAxisSensorAtRest, "IsSixAxisSensorAtRest"},
241 {83, &Hid::IsFirmwareUpdateAvailableForSixAxisSensor, "IsFirmwareUpdateAvailableForSixAxisSensor"}, 241 {83, &Hid::IsFirmwareUpdateAvailableForSixAxisSensor, "IsFirmwareUpdateAvailableForSixAxisSensor"},
242 {84, nullptr, "EnableSixAxisSensorUnalteredPassthrough"},
243 {85, nullptr, "IsSixAxisSensorUnalteredPassthroughEnabled"},
244 {86, nullptr, "StoreSixAxisSensorCalibrationParameter"},
245 {87, nullptr, "LoadSixAxisSensorCalibrationParameter"},
246 {88, nullptr, "GetSixAxisSensorIcInformation"},
247 {89, nullptr, "ResetIsSixAxisSensorDeviceNewlyAssigned"},
242 {91, &Hid::ActivateGesture, "ActivateGesture"}, 248 {91, &Hid::ActivateGesture, "ActivateGesture"},
243 {100, &Hid::SetSupportedNpadStyleSet, "SetSupportedNpadStyleSet"}, 249 {100, &Hid::SetSupportedNpadStyleSet, "SetSupportedNpadStyleSet"},
244 {101, &Hid::GetSupportedNpadStyleSet, "GetSupportedNpadStyleSet"}, 250 {101, &Hid::GetSupportedNpadStyleSet, "GetSupportedNpadStyleSet"},
@@ -1656,6 +1662,9 @@ public:
1656 {12, nullptr, "UnsetTouchScreenAutoPilotState"}, 1662 {12, nullptr, "UnsetTouchScreenAutoPilotState"},
1657 {13, nullptr, "GetTouchScreenConfiguration"}, 1663 {13, nullptr, "GetTouchScreenConfiguration"},
1658 {14, nullptr, "ProcessTouchScreenAutoTune"}, 1664 {14, nullptr, "ProcessTouchScreenAutoTune"},
1665 {15, nullptr, "ForceStopTouchScreenManagement"},
1666 {16, nullptr, "ForceRestartTouchScreenManagement"},
1667 {17, nullptr, "IsTouchScreenManaged"},
1659 {20, nullptr, "DeactivateMouse"}, 1668 {20, nullptr, "DeactivateMouse"},
1660 {21, nullptr, "SetMouseAutoPilotState"}, 1669 {21, nullptr, "SetMouseAutoPilotState"},
1661 {22, nullptr, "UnsetMouseAutoPilotState"}, 1670 {22, nullptr, "UnsetMouseAutoPilotState"},
diff --git a/src/core/hle/service/npns/npns.cpp b/src/core/hle/service/npns/npns.cpp
index e4c703da4..32533cd94 100644
--- a/src/core/hle/service/npns/npns.cpp
+++ b/src/core/hle/service/npns/npns.cpp
@@ -31,6 +31,7 @@ public:
31 {24, nullptr, "DestroyTokenWithApplicationId"}, 31 {24, nullptr, "DestroyTokenWithApplicationId"},
32 {25, nullptr, "QueryIsTokenValid"}, 32 {25, nullptr, "QueryIsTokenValid"},
33 {26, nullptr, "ListenToMyApplicationId"}, 33 {26, nullptr, "ListenToMyApplicationId"},
34 {27, nullptr, "DestroyTokenAll"},
34 {31, nullptr, "UploadTokenToBaaS"}, 35 {31, nullptr, "UploadTokenToBaaS"},
35 {32, nullptr, "DestroyTokenForBaaS"}, 36 {32, nullptr, "DestroyTokenForBaaS"},
36 {33, nullptr, "CreateTokenForBaaS"}, 37 {33, nullptr, "CreateTokenForBaaS"},
diff --git a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp
index a33e47d0b..789000294 100644
--- a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp
@@ -16,7 +16,7 @@ namespace Service::Nvidia::Devices {
16 16
17nvdisp_disp0::nvdisp_disp0(Core::System& system_, std::shared_ptr<nvmap> nvmap_dev_) 17nvdisp_disp0::nvdisp_disp0(Core::System& system_, std::shared_ptr<nvmap> nvmap_dev_)
18 : nvdevice{system_}, nvmap_dev{std::move(nvmap_dev_)} {} 18 : nvdevice{system_}, nvmap_dev{std::move(nvmap_dev_)} {}
19nvdisp_disp0 ::~nvdisp_disp0() = default; 19nvdisp_disp0::~nvdisp_disp0() = default;
20 20
21NvResult nvdisp_disp0::Ioctl1(DeviceFD fd, Ioctl command, const std::vector<u8>& input, 21NvResult nvdisp_disp0::Ioctl1(DeviceFD fd, Ioctl command, const std::vector<u8>& input,
22 std::vector<u8>& output) { 22 std::vector<u8>& output) {
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp
index 7d85ecb6a..b9e765f1d 100644
--- a/src/core/hle/service/sockets/bsd.cpp
+++ b/src/core/hle/service/sockets/bsd.cpp
@@ -415,6 +415,18 @@ void BSD::Write(Kernel::HLERequestContext& ctx) {
415 }); 415 });
416} 416}
417 417
418void BSD::Read(Kernel::HLERequestContext& ctx) {
419 IPC::RequestParser rp{ctx};
420 const s32 fd = rp.Pop<s32>();
421
422 LOG_WARNING(Service, "(STUBBED) called. fd={} len={}", fd, ctx.GetWriteBufferSize());
423
424 IPC::ResponseBuilder rb{ctx, 4};
425 rb.Push(ResultSuccess);
426 rb.Push<u32>(0); // ret
427 rb.Push<u32>(0); // bsd errno
428}
429
418void BSD::Close(Kernel::HLERequestContext& ctx) { 430void BSD::Close(Kernel::HLERequestContext& ctx) {
419 IPC::RequestParser rp{ctx}; 431 IPC::RequestParser rp{ctx};
420 const s32 fd = rp.Pop<s32>(); 432 const s32 fd = rp.Pop<s32>();
@@ -855,7 +867,7 @@ BSD::BSD(Core::System& system_, const char* name) : ServiceFramework{system_, na
855 {22, &BSD::Shutdown, "Shutdown"}, 867 {22, &BSD::Shutdown, "Shutdown"},
856 {23, nullptr, "ShutdownAllSockets"}, 868 {23, nullptr, "ShutdownAllSockets"},
857 {24, &BSD::Write, "Write"}, 869 {24, &BSD::Write, "Write"},
858 {25, nullptr, "Read"}, 870 {25, &BSD::Read, "Read"},
859 {26, &BSD::Close, "Close"}, 871 {26, &BSD::Close, "Close"},
860 {27, nullptr, "DuplicateSocket"}, 872 {27, nullptr, "DuplicateSocket"},
861 {28, nullptr, "GetResourceStatistics"}, 873 {28, nullptr, "GetResourceStatistics"},
diff --git a/src/core/hle/service/sockets/bsd.h b/src/core/hle/service/sockets/bsd.h
index 1d2df9c61..d68beef5c 100644
--- a/src/core/hle/service/sockets/bsd.h
+++ b/src/core/hle/service/sockets/bsd.h
@@ -135,6 +135,7 @@ private:
135 void Send(Kernel::HLERequestContext& ctx); 135 void Send(Kernel::HLERequestContext& ctx);
136 void SendTo(Kernel::HLERequestContext& ctx); 136 void SendTo(Kernel::HLERequestContext& ctx);
137 void Write(Kernel::HLERequestContext& ctx); 137 void Write(Kernel::HLERequestContext& ctx);
138 void Read(Kernel::HLERequestContext& ctx);
138 void Close(Kernel::HLERequestContext& ctx); 139 void Close(Kernel::HLERequestContext& ctx);
139 void EventFd(Kernel::HLERequestContext& ctx); 140 void EventFd(Kernel::HLERequestContext& ctx);
140 141
diff --git a/src/core/hle/service/time/system_clock_core.cpp b/src/core/hle/service/time/system_clock_core.cpp
index bd334bbef..5c2354cdd 100644
--- a/src/core/hle/service/time/system_clock_core.cpp
+++ b/src/core/hle/service/time/system_clock_core.cpp
@@ -13,7 +13,7 @@ SystemClockCore::SystemClockCore(SteadyClockCore& steady_clock_core_)
13 context.steady_time_point.clock_source_id = steady_clock_core.GetClockSourceId(); 13 context.steady_time_point.clock_source_id = steady_clock_core.GetClockSourceId();
14} 14}
15 15
16SystemClockCore ::~SystemClockCore() = default; 16SystemClockCore::~SystemClockCore() = default;
17 17
18ResultCode SystemClockCore::GetCurrentTime(Core::System& system, s64& posix_time) const { 18ResultCode SystemClockCore::GetCurrentTime(Core::System& system, s64& posix_time) const {
19 posix_time = 0; 19 posix_time = 0;
diff --git a/src/core/hle/service/time/time_zone_service.cpp b/src/core/hle/service/time/time_zone_service.cpp
index 5c3108768..3871e7316 100644
--- a/src/core/hle/service/time/time_zone_service.cpp
+++ b/src/core/hle/service/time/time_zone_service.cpp
@@ -10,8 +10,8 @@
10 10
11namespace Service::Time { 11namespace Service::Time {
12 12
13ITimeZoneService ::ITimeZoneService(Core::System& system_, 13ITimeZoneService::ITimeZoneService(Core::System& system_,
14 TimeZone::TimeZoneContentManager& time_zone_manager_) 14 TimeZone::TimeZoneContentManager& time_zone_manager_)
15 : ServiceFramework{system_, "ITimeZoneService"}, time_zone_content_manager{time_zone_manager_} { 15 : ServiceFramework{system_, "ITimeZoneService"}, time_zone_content_manager{time_zone_manager_} {
16 static const FunctionInfo functions[] = { 16 static const FunctionInfo functions[] = {
17 {0, &ITimeZoneService::GetDeviceLocationName, "GetDeviceLocationName"}, 17 {0, &ITimeZoneService::GetDeviceLocationName, "GetDeviceLocationName"},
diff --git a/src/core/hle/service/usb/usb.cpp b/src/core/hle/service/usb/usb.cpp
index 7f436c3bb..2ee103b37 100644
--- a/src/core/hle/service/usb/usb.cpp
+++ b/src/core/hle/service/usb/usb.cpp
@@ -97,7 +97,7 @@ public:
97 {3, nullptr, "GetAlternateInterface"}, 97 {3, nullptr, "GetAlternateInterface"},
98 {4, nullptr, "GetCurrentFrame"}, 98 {4, nullptr, "GetCurrentFrame"},
99 {5, nullptr, "CtrlXferAsync"}, 99 {5, nullptr, "CtrlXferAsync"},
100 {6, nullptr, "Unknown6"}, 100 {6, nullptr, "GetCtrlXferCompletionEvent"},
101 {7, nullptr, "GetCtrlXferReport"}, 101 {7, nullptr, "GetCtrlXferReport"},
102 {8, nullptr, "ResetDevice"}, 102 {8, nullptr, "ResetDevice"},
103 {9, nullptr, "OpenUsbEp"}, 103 {9, nullptr, "OpenUsbEp"},
@@ -183,8 +183,8 @@ public:
183 {4, nullptr, "GetHostPdcFirmwareRevision"}, 183 {4, nullptr, "GetHostPdcFirmwareRevision"},
184 {5, nullptr, "GetHostPdcManufactureId"}, 184 {5, nullptr, "GetHostPdcManufactureId"},
185 {6, nullptr, "GetHostPdcDeviceId"}, 185 {6, nullptr, "GetHostPdcDeviceId"},
186 {7, nullptr, "AwakeCradle"}, 186 {7, nullptr, "EnableCradleRecovery"},
187 {8, nullptr, "SleepCradle"}, 187 {8, nullptr, "DisableCradleRecovery"},
188 }; 188 };
189 // clang-format on 189 // clang-format on
190 190
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index 8e8fc40ca..be3d52d54 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -831,6 +831,7 @@ public:
831 {6010, nullptr, "GetLayerPresentationAllFencesExpiredEvent"}, 831 {6010, nullptr, "GetLayerPresentationAllFencesExpiredEvent"},
832 {6011, nullptr, "EnableLayerAutoClearTransitionBuffer"}, 832 {6011, nullptr, "EnableLayerAutoClearTransitionBuffer"},
833 {6012, nullptr, "DisableLayerAutoClearTransitionBuffer"}, 833 {6012, nullptr, "DisableLayerAutoClearTransitionBuffer"},
834 {6013, nullptr, "SetLayerOpacity"},
834 {7000, nullptr, "SetContentVisibility"}, 835 {7000, nullptr, "SetContentVisibility"},
835 {8000, nullptr, "SetConductorLayer"}, 836 {8000, nullptr, "SetConductorLayer"},
836 {8001, nullptr, "SetTimestampTracking"}, 837 {8001, nullptr, "SetTimestampTracking"},
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp
index 18d7d8817..f3907c65a 100644
--- a/src/input_common/main.cpp
+++ b/src/input_common/main.cpp
@@ -346,8 +346,8 @@ void InputSubsystem::ReloadInputDevices() {
346 impl->udp->ReloadSockets(); 346 impl->udp->ReloadSockets();
347} 347}
348 348
349std::vector<std::unique_ptr<Polling::DevicePoller>> InputSubsystem::GetPollers([ 349std::vector<std::unique_ptr<Polling::DevicePoller>> InputSubsystem::GetPollers(
350 [maybe_unused]] Polling::DeviceType type) const { 350 [[maybe_unused]] Polling::DeviceType type) const {
351#ifdef HAVE_SDL2 351#ifdef HAVE_SDL2
352 return impl->sdl->GetPollers(type); 352 return impl->sdl->GetPollers(type);
353#else 353#else
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp
index 580063fa9..170db269a 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp
@@ -58,8 +58,8 @@ void GetCbuf(EmitContext& ctx, std::string_view ret, const IR::Value& binding,
58 const auto cbuf{fmt::format("{}_cbuf{}", ctx.stage_name, binding.U32())}; 58 const auto cbuf{fmt::format("{}_cbuf{}", ctx.stage_name, binding.U32())};
59 const auto cbuf_cast{fmt::format("{}({}[{}]{{}})", cast, cbuf, index)}; 59 const auto cbuf_cast{fmt::format("{}({}[{}]{{}})", cast, cbuf, index)};
60 const auto extraction{num_bits == 32 ? cbuf_cast 60 const auto extraction{num_bits == 32 ? cbuf_cast
61 : fmt ::format("bitfieldExtract({},int({}),{})", cbuf_cast, 61 : fmt::format("bitfieldExtract({},int({}),{})", cbuf_cast,
62 bit_offset, num_bits)}; 62 bit_offset, num_bits)};
63 if (!component_indexing_bug) { 63 if (!component_indexing_bug) {
64 const auto result{fmt::format(fmt::runtime(extraction), swizzle)}; 64 const auto result{fmt::format(fmt::runtime(extraction), swizzle)};
65 ctx.Add("{}={};", ret, result); 65 ctx.Add("{}={};", ret, result);
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
index 68f360b3c..6f60c6574 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
@@ -477,7 +477,13 @@ void EmitSetSampleMask(EmitContext& ctx, Id value) {
477} 477}
478 478
479void EmitSetFragDepth(EmitContext& ctx, Id value) { 479void EmitSetFragDepth(EmitContext& ctx, Id value) {
480 ctx.OpStore(ctx.frag_depth, value); 480 if (!ctx.runtime_info.convert_depth_mode) {
481 ctx.OpStore(ctx.frag_depth, value);
482 return;
483 }
484 const Id unit{ctx.Const(0.5f)};
485 const Id new_depth{ctx.OpFma(ctx.F32[1], value, unit, unit)};
486 ctx.OpStore(ctx.frag_depth, new_depth);
481} 487}
482 488
483void EmitGetZFlag(EmitContext&) { 489void EmitGetZFlag(EmitContext&) {
diff --git a/src/shader_recompiler/object_pool.h b/src/shader_recompiler/object_pool.h
index f3b12d04b..a12ddcc8f 100644
--- a/src/shader_recompiler/object_pool.h
+++ b/src/shader_recompiler/object_pool.h
@@ -11,14 +11,16 @@
11namespace Shader { 11namespace Shader {
12 12
13template <typename T> 13template <typename T>
14requires std::is_destructible_v<T> class ObjectPool { 14requires std::is_destructible_v<T>
15class ObjectPool {
15public: 16public:
16 explicit ObjectPool(size_t chunk_size = 8192) : new_chunk_size{chunk_size} { 17 explicit ObjectPool(size_t chunk_size = 8192) : new_chunk_size{chunk_size} {
17 node = &chunks.emplace_back(new_chunk_size); 18 node = &chunks.emplace_back(new_chunk_size);
18 } 19 }
19 20
20 template <typename... Args> 21 template <typename... Args>
21 requires std::is_constructible_v<T, Args...>[[nodiscard]] T* Create(Args&&... args) { 22 requires std::is_constructible_v<T, Args...>
23 [[nodiscard]] T* Create(Args&&... args) {
22 return std::construct_at(Memory(), std::forward<Args>(args)...); 24 return std::construct_at(Memory(), std::forward<Args>(args)...);
23 } 25 }
24 26
diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt
index c9cff7450..20d748c12 100644
--- a/src/video_core/host_shaders/CMakeLists.txt
+++ b/src/video_core/host_shaders/CMakeLists.txt
@@ -6,7 +6,6 @@ set(SHADER_FILES
6 convert_float_to_depth.frag 6 convert_float_to_depth.frag
7 full_screen_triangle.vert 7 full_screen_triangle.vert
8 opengl_copy_bc4.comp 8 opengl_copy_bc4.comp
9 opengl_copy_bgra.comp
10 opengl_present.frag 9 opengl_present.frag
11 opengl_present.vert 10 opengl_present.vert
12 pitch_unswizzle.comp 11 pitch_unswizzle.comp
diff --git a/src/video_core/host_shaders/opengl_copy_bgra.comp b/src/video_core/host_shaders/opengl_copy_bgra.comp
deleted file mode 100644
index 2571a4abf..000000000
--- a/src/video_core/host_shaders/opengl_copy_bgra.comp
+++ /dev/null
@@ -1,15 +0,0 @@
1// Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#version 430 core
6
7layout (local_size_x = 4, local_size_y = 4) in;
8
9layout(binding = 0, rgba8) readonly uniform image2DArray bgr_input;
10layout(binding = 1, rgba8) writeonly uniform image2DArray bgr_output;
11
12void main() {
13 vec4 color = imageLoad(bgr_input, ivec3(gl_GlobalInvocationID));
14 imageStore(bgr_output, ivec3(gl_GlobalInvocationID), color.bgra);
15}
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index b0aee6cc1..54dae2c41 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -461,7 +461,7 @@ bool TextureCacheRuntime::CanImageBeCopied(const Image& dst, const Image& src) {
461 if (dst.info.type == ImageType::e3D && dst.info.format == PixelFormat::BC4_UNORM) { 461 if (dst.info.type == ImageType::e3D && dst.info.format == PixelFormat::BC4_UNORM) {
462 return false; 462 return false;
463 } 463 }
464 if (IsPixelFormatBGR(dst.info.format) || IsPixelFormatBGR(src.info.format)) { 464 if (IsPixelFormatBGR(dst.info.format) != IsPixelFormatBGR(src.info.format)) {
465 return false; 465 return false;
466 } 466 }
467 return true; 467 return true;
@@ -473,7 +473,7 @@ void TextureCacheRuntime::EmulateCopyImage(Image& dst, Image& src,
473 ASSERT(src.info.type == ImageType::e3D); 473 ASSERT(src.info.type == ImageType::e3D);
474 util_shaders.CopyBC4(dst, src, copies); 474 util_shaders.CopyBC4(dst, src, copies);
475 } else if (IsPixelFormatBGR(dst.info.format) || IsPixelFormatBGR(src.info.format)) { 475 } else if (IsPixelFormatBGR(dst.info.format) || IsPixelFormatBGR(src.info.format)) {
476 util_shaders.CopyBGR(dst, src, copies); 476 bgr_copy_pass.CopyBGR(dst, src, copies);
477 } else { 477 } else {
478 UNREACHABLE(); 478 UNREACHABLE();
479 } 479 }
@@ -1112,4 +1112,37 @@ Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM
1112 framebuffer.handle = handle; 1112 framebuffer.handle = handle;
1113} 1113}
1114 1114
1115void BGRCopyPass::CopyBGR(Image& dst_image, Image& src_image,
1116 std::span<const VideoCommon::ImageCopy> copies) {
1117 static constexpr VideoCommon::Offset3D zero_offset{0, 0, 0};
1118 const u32 requested_pbo_size =
1119 std::max(src_image.unswizzled_size_bytes, dst_image.unswizzled_size_bytes);
1120
1121 if (bgr_pbo_size < requested_pbo_size) {
1122 bgr_pbo.Create();
1123 bgr_pbo_size = requested_pbo_size;
1124 glNamedBufferData(bgr_pbo.handle, bgr_pbo_size, nullptr, GL_STREAM_COPY);
1125 }
1126 for (const ImageCopy& copy : copies) {
1127 ASSERT(copy.src_offset == zero_offset);
1128 ASSERT(copy.dst_offset == zero_offset);
1129
1130 // Copy from source to PBO
1131 glPixelStorei(GL_PACK_ALIGNMENT, 1);
1132 glPixelStorei(GL_PACK_ROW_LENGTH, copy.extent.width);
1133 glBindBuffer(GL_PIXEL_PACK_BUFFER, bgr_pbo.handle);
1134 glGetTextureSubImage(src_image.Handle(), 0, 0, 0, 0, copy.extent.width, copy.extent.height,
1135 copy.src_subresource.num_layers, src_image.GlFormat(),
1136 src_image.GlType(), static_cast<GLsizei>(bgr_pbo_size), nullptr);
1137
1138 // Copy from PBO to destination in desired GL format
1139 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1140 glPixelStorei(GL_UNPACK_ROW_LENGTH, copy.extent.width);
1141 glBindBuffer(GL_PIXEL_UNPACK_BUFFER, bgr_pbo.handle);
1142 glTextureSubImage3D(dst_image.Handle(), 0, 0, 0, 0, copy.extent.width, copy.extent.height,
1143 copy.dst_subresource.num_layers, dst_image.GlFormat(),
1144 dst_image.GlType(), nullptr);
1145 }
1146}
1147
1115} // namespace OpenGL 1148} // namespace OpenGL
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h
index 4a4f6301c..c498a8a8f 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.h
+++ b/src/video_core/renderer_opengl/gl_texture_cache.h
@@ -47,6 +47,19 @@ struct FormatProperties {
47 bool is_compressed; 47 bool is_compressed;
48}; 48};
49 49
50class BGRCopyPass {
51public:
52 BGRCopyPass() = default;
53 ~BGRCopyPass() = default;
54
55 void CopyBGR(Image& dst_image, Image& src_image,
56 std::span<const VideoCommon::ImageCopy> copies);
57
58private:
59 OGLBuffer bgr_pbo;
60 size_t bgr_pbo_size{};
61};
62
50class TextureCacheRuntime { 63class TextureCacheRuntime {
51 friend Framebuffer; 64 friend Framebuffer;
52 friend Image; 65 friend Image;
@@ -118,6 +131,7 @@ private:
118 const Device& device; 131 const Device& device;
119 StateTracker& state_tracker; 132 StateTracker& state_tracker;
120 UtilShaders util_shaders; 133 UtilShaders util_shaders;
134 BGRCopyPass bgr_copy_pass;
121 135
122 std::array<std::unordered_map<GLenum, FormatProperties>, 3> format_properties; 136 std::array<std::unordered_map<GLenum, FormatProperties>, 3> format_properties;
123 bool has_broken_texture_view_formats = false; 137 bool has_broken_texture_view_formats = false;
@@ -162,6 +176,14 @@ public:
162 return texture.handle; 176 return texture.handle;
163 } 177 }
164 178
179 GLuint GlFormat() const noexcept {
180 return gl_format;
181 }
182
183 GLuint GlType() const noexcept {
184 return gl_type;
185 }
186
165private: 187private:
166 void CopyBufferToImage(const VideoCommon::BufferImageCopy& copy, size_t buffer_offset); 188 void CopyBufferToImage(const VideoCommon::BufferImageCopy& copy, size_t buffer_offset);
167 189
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h
index 672f94bfc..39158aa3e 100644
--- a/src/video_core/renderer_opengl/maxwell_to_gl.h
+++ b/src/video_core/renderer_opengl/maxwell_to_gl.h
@@ -52,7 +52,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> FORMAT_TAB
52 {GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}, // BC6H_UFLOAT 52 {GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}, // BC6H_UFLOAT
53 {GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT}, // BC6H_SFLOAT 53 {GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT}, // BC6H_SFLOAT
54 {GL_COMPRESSED_RGBA_ASTC_4x4_KHR}, // ASTC_2D_4X4_UNORM 54 {GL_COMPRESSED_RGBA_ASTC_4x4_KHR}, // ASTC_2D_4X4_UNORM
55 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE}, // B8G8R8A8_UNORM 55 {GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV}, // B8G8R8A8_UNORM
56 {GL_RGBA32F, GL_RGBA, GL_FLOAT}, // R32G32B32A32_FLOAT 56 {GL_RGBA32F, GL_RGBA, GL_FLOAT}, // R32G32B32A32_FLOAT
57 {GL_RGBA32I, GL_RGBA_INTEGER, GL_INT}, // R32G32B32A32_SINT 57 {GL_RGBA32I, GL_RGBA_INTEGER, GL_INT}, // R32G32B32A32_SINT
58 {GL_RG32F, GL_RG, GL_FLOAT}, // R32G32_FLOAT 58 {GL_RG32F, GL_RG, GL_FLOAT}, // R32G32_FLOAT
@@ -81,7 +81,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> FORMAT_TAB
81 {GL_COMPRESSED_RGBA_ASTC_8x8_KHR}, // ASTC_2D_8X8_UNORM 81 {GL_COMPRESSED_RGBA_ASTC_8x8_KHR}, // ASTC_2D_8X8_UNORM
82 {GL_COMPRESSED_RGBA_ASTC_8x5_KHR}, // ASTC_2D_8X5_UNORM 82 {GL_COMPRESSED_RGBA_ASTC_8x5_KHR}, // ASTC_2D_8X5_UNORM
83 {GL_COMPRESSED_RGBA_ASTC_5x4_KHR}, // ASTC_2D_5X4_UNORM 83 {GL_COMPRESSED_RGBA_ASTC_5x4_KHR}, // ASTC_2D_5X4_UNORM
84 {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE}, // B8G8R8A8_SRGB 84 {GL_SRGB8_ALPHA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV}, // B8G8R8A8_SRGB
85 {GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT}, // BC1_RGBA_SRGB 85 {GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT}, // BC1_RGBA_SRGB
86 {GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT}, // BC2_SRGB 86 {GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT}, // BC2_SRGB
87 {GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}, // BC3_SRGB 87 {GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}, // BC3_SRGB
diff --git a/src/video_core/renderer_opengl/util_shaders.cpp b/src/video_core/renderer_opengl/util_shaders.cpp
index 333f35a1c..897c380b3 100644
--- a/src/video_core/renderer_opengl/util_shaders.cpp
+++ b/src/video_core/renderer_opengl/util_shaders.cpp
@@ -14,7 +14,6 @@
14#include "video_core/host_shaders/block_linear_unswizzle_2d_comp.h" 14#include "video_core/host_shaders/block_linear_unswizzle_2d_comp.h"
15#include "video_core/host_shaders/block_linear_unswizzle_3d_comp.h" 15#include "video_core/host_shaders/block_linear_unswizzle_3d_comp.h"
16#include "video_core/host_shaders/opengl_copy_bc4_comp.h" 16#include "video_core/host_shaders/opengl_copy_bc4_comp.h"
17#include "video_core/host_shaders/opengl_copy_bgra_comp.h"
18#include "video_core/host_shaders/pitch_unswizzle_comp.h" 17#include "video_core/host_shaders/pitch_unswizzle_comp.h"
19#include "video_core/renderer_opengl/gl_shader_manager.h" 18#include "video_core/renderer_opengl/gl_shader_manager.h"
20#include "video_core/renderer_opengl/gl_shader_util.h" 19#include "video_core/renderer_opengl/gl_shader_util.h"
@@ -44,11 +43,6 @@ namespace {
44OGLProgram MakeProgram(std::string_view source) { 43OGLProgram MakeProgram(std::string_view source) {
45 return CreateProgram(source, GL_COMPUTE_SHADER); 44 return CreateProgram(source, GL_COMPUTE_SHADER);
46} 45}
47
48size_t NumPixelsInCopy(const VideoCommon::ImageCopy& copy) {
49 return static_cast<size_t>(copy.extent.width * copy.extent.height *
50 copy.src_subresource.num_layers);
51}
52} // Anonymous namespace 46} // Anonymous namespace
53 47
54UtilShaders::UtilShaders(ProgramManager& program_manager_) 48UtilShaders::UtilShaders(ProgramManager& program_manager_)
@@ -56,7 +50,6 @@ UtilShaders::UtilShaders(ProgramManager& program_manager_)
56 block_linear_unswizzle_2d_program(MakeProgram(BLOCK_LINEAR_UNSWIZZLE_2D_COMP)), 50 block_linear_unswizzle_2d_program(MakeProgram(BLOCK_LINEAR_UNSWIZZLE_2D_COMP)),
57 block_linear_unswizzle_3d_program(MakeProgram(BLOCK_LINEAR_UNSWIZZLE_3D_COMP)), 51 block_linear_unswizzle_3d_program(MakeProgram(BLOCK_LINEAR_UNSWIZZLE_3D_COMP)),
58 pitch_unswizzle_program(MakeProgram(PITCH_UNSWIZZLE_COMP)), 52 pitch_unswizzle_program(MakeProgram(PITCH_UNSWIZZLE_COMP)),
59 copy_bgra_program(MakeProgram(OPENGL_COPY_BGRA_COMP)),
60 copy_bc4_program(MakeProgram(OPENGL_COPY_BC4_COMP)) { 53 copy_bc4_program(MakeProgram(OPENGL_COPY_BC4_COMP)) {
61 const auto swizzle_table = Tegra::Texture::MakeSwizzleTable(); 54 const auto swizzle_table = Tegra::Texture::MakeSwizzleTable();
62 swizzle_table_buffer.Create(); 55 swizzle_table_buffer.Create();
@@ -255,43 +248,6 @@ void UtilShaders::CopyBC4(Image& dst_image, Image& src_image, std::span<const Im
255 program_manager.RestoreGuestCompute(); 248 program_manager.RestoreGuestCompute();
256} 249}
257 250
258void UtilShaders::CopyBGR(Image& dst_image, Image& src_image,
259 std::span<const VideoCommon::ImageCopy> copies) {
260 static constexpr GLuint BINDING_INPUT_IMAGE = 0;
261 static constexpr GLuint BINDING_OUTPUT_IMAGE = 1;
262 static constexpr VideoCommon::Offset3D zero_offset{0, 0, 0};
263 const u32 bytes_per_block = BytesPerBlock(dst_image.info.format);
264 switch (bytes_per_block) {
265 case 2:
266 // BGR565 copy
267 for (const ImageCopy& copy : copies) {
268 ASSERT(copy.src_offset == zero_offset);
269 ASSERT(copy.dst_offset == zero_offset);
270 bgr_copy_pass.Execute(dst_image, src_image, copy);
271 }
272 break;
273 case 4: {
274 // BGRA8 copy
275 program_manager.BindComputeProgram(copy_bgra_program.handle);
276 constexpr GLenum FORMAT = GL_RGBA8;
277 for (const ImageCopy& copy : copies) {
278 ASSERT(copy.src_offset == zero_offset);
279 ASSERT(copy.dst_offset == zero_offset);
280 glBindImageTexture(BINDING_INPUT_IMAGE, src_image.StorageHandle(),
281 copy.src_subresource.base_level, GL_FALSE, 0, GL_READ_ONLY, FORMAT);
282 glBindImageTexture(BINDING_OUTPUT_IMAGE, dst_image.StorageHandle(),
283 copy.dst_subresource.base_level, GL_FALSE, 0, GL_WRITE_ONLY, FORMAT);
284 glDispatchCompute(copy.extent.width, copy.extent.height, copy.extent.depth);
285 }
286 program_manager.RestoreGuestCompute();
287 break;
288 }
289 default:
290 UNREACHABLE();
291 break;
292 }
293}
294
295GLenum StoreFormat(u32 bytes_per_block) { 251GLenum StoreFormat(u32 bytes_per_block) {
296 switch (bytes_per_block) { 252 switch (bytes_per_block) {
297 case 1: 253 case 1:
@@ -309,36 +265,4 @@ GLenum StoreFormat(u32 bytes_per_block) {
309 return GL_R8UI; 265 return GL_R8UI;
310} 266}
311 267
312void Bgr565CopyPass::Execute(const Image& dst_image, const Image& src_image,
313 const ImageCopy& copy) {
314 if (CopyBufferCreationNeeded(copy)) {
315 CreateNewCopyBuffer(copy, GL_TEXTURE_2D_ARRAY, GL_RGB565);
316 }
317 // Copy from source to PBO
318 glPixelStorei(GL_PACK_ALIGNMENT, 1);
319 glPixelStorei(GL_PACK_ROW_LENGTH, copy.extent.width);
320 glBindBuffer(GL_PIXEL_PACK_BUFFER, bgr16_pbo.handle);
321 glGetTextureSubImage(src_image.Handle(), 0, 0, 0, 0, copy.extent.width, copy.extent.height,
322 copy.src_subresource.num_layers, GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
323 static_cast<GLsizei>(bgr16_pbo_size), nullptr);
324
325 // Copy from PBO to destination in reverse order
326 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
327 glPixelStorei(GL_UNPACK_ROW_LENGTH, copy.extent.width);
328 glBindBuffer(GL_PIXEL_UNPACK_BUFFER, bgr16_pbo.handle);
329 glTextureSubImage3D(dst_image.Handle(), 0, 0, 0, 0, copy.extent.width, copy.extent.height,
330 copy.dst_subresource.num_layers, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV,
331 nullptr);
332}
333
334bool Bgr565CopyPass::CopyBufferCreationNeeded(const ImageCopy& copy) {
335 return bgr16_pbo_size < NumPixelsInCopy(copy) * sizeof(u16);
336}
337
338void Bgr565CopyPass::CreateNewCopyBuffer(const ImageCopy& copy, GLenum target, GLuint format) {
339 bgr16_pbo.Create();
340 bgr16_pbo_size = NumPixelsInCopy(copy) * sizeof(u16);
341 glNamedBufferData(bgr16_pbo.handle, bgr16_pbo_size, nullptr, GL_STREAM_COPY);
342}
343
344} // namespace OpenGL 268} // namespace OpenGL
diff --git a/src/video_core/renderer_opengl/util_shaders.h b/src/video_core/renderer_opengl/util_shaders.h
index ef881e35f..5de95ea7a 100644
--- a/src/video_core/renderer_opengl/util_shaders.h
+++ b/src/video_core/renderer_opengl/util_shaders.h
@@ -19,22 +19,6 @@ class ProgramManager;
19 19
20struct ImageBufferMap; 20struct ImageBufferMap;
21 21
22class Bgr565CopyPass {
23public:
24 Bgr565CopyPass() = default;
25 ~Bgr565CopyPass() = default;
26
27 void Execute(const Image& dst_image, const Image& src_image,
28 const VideoCommon::ImageCopy& copy);
29
30private:
31 [[nodiscard]] bool CopyBufferCreationNeeded(const VideoCommon::ImageCopy& copy);
32 void CreateNewCopyBuffer(const VideoCommon::ImageCopy& copy, GLenum target, GLuint format);
33
34 OGLBuffer bgr16_pbo;
35 size_t bgr16_pbo_size{};
36};
37
38class UtilShaders { 22class UtilShaders {
39public: 23public:
40 explicit UtilShaders(ProgramManager& program_manager); 24 explicit UtilShaders(ProgramManager& program_manager);
@@ -55,9 +39,6 @@ public:
55 void CopyBC4(Image& dst_image, Image& src_image, 39 void CopyBC4(Image& dst_image, Image& src_image,
56 std::span<const VideoCommon::ImageCopy> copies); 40 std::span<const VideoCommon::ImageCopy> copies);
57 41
58 void CopyBGR(Image& dst_image, Image& src_image,
59 std::span<const VideoCommon::ImageCopy> copies);
60
61private: 42private:
62 ProgramManager& program_manager; 43 ProgramManager& program_manager;
63 44
@@ -67,10 +48,7 @@ private:
67 OGLProgram block_linear_unswizzle_2d_program; 48 OGLProgram block_linear_unswizzle_2d_program;
68 OGLProgram block_linear_unswizzle_3d_program; 49 OGLProgram block_linear_unswizzle_3d_program;
69 OGLProgram pitch_unswizzle_program; 50 OGLProgram pitch_unswizzle_program;
70 OGLProgram copy_bgra_program;
71 OGLProgram copy_bc4_program; 51 OGLProgram copy_bc4_program;
72
73 Bgr565CopyPass bgr_copy_pass;
74}; 52};
75 53
76GLenum StoreFormat(u32 bytes_per_block); 54GLenum StoreFormat(u32 bytes_per_block);
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp
index 9ff0a28cd..74822814d 100644
--- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp
+++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp
@@ -97,19 +97,14 @@ RendererVulkan::RendererVulkan(Core::TelemetrySession& telemetry_session_,
97 Core::Frontend::EmuWindow& emu_window, 97 Core::Frontend::EmuWindow& emu_window,
98 Core::Memory::Memory& cpu_memory_, Tegra::GPU& gpu_, 98 Core::Memory::Memory& cpu_memory_, Tegra::GPU& gpu_,
99 std::unique_ptr<Core::Frontend::GraphicsContext> context_) try 99 std::unique_ptr<Core::Frontend::GraphicsContext> context_) try
100 : RendererBase(emu_window, std::move(context_)), 100 : RendererBase(emu_window, std::move(context_)), telemetry_session(telemetry_session_),
101 telemetry_session(telemetry_session_), 101 cpu_memory(cpu_memory_), gpu(gpu_), library(OpenLibrary()),
102 cpu_memory(cpu_memory_),
103 gpu(gpu_),
104 library(OpenLibrary()),
105 instance(CreateInstance(library, dld, VK_API_VERSION_1_1, render_window.GetWindowInfo().type, 102 instance(CreateInstance(library, dld, VK_API_VERSION_1_1, render_window.GetWindowInfo().type,
106 true, Settings::values.renderer_debug.GetValue())), 103 true, Settings::values.renderer_debug.GetValue())),
107 debug_callback(Settings::values.renderer_debug ? CreateDebugCallback(instance) : nullptr), 104 debug_callback(Settings::values.renderer_debug ? CreateDebugCallback(instance) : nullptr),
108 surface(CreateSurface(instance, render_window)), 105 surface(CreateSurface(instance, render_window)),
109 device(CreateDevice(instance, dld, *surface)), 106 device(CreateDevice(instance, dld, *surface)), memory_allocator(device, false),
110 memory_allocator(device, false), 107 state_tracker(gpu), scheduler(device, state_tracker),
111 state_tracker(gpu),
112 scheduler(device, state_tracker),
113 swapchain(*surface, device, scheduler, render_window.GetFramebufferLayout().width, 108 swapchain(*surface, device, scheduler, render_window.GetFramebufferLayout().width,
114 render_window.GetFramebufferLayout().height, false), 109 render_window.GetFramebufferLayout().height, false),
115 blit_screen(cpu_memory, render_window, device, memory_allocator, swapchain, scheduler, 110 blit_screen(cpu_memory, render_window, device, memory_allocator, swapchain, scheduler,
@@ -149,7 +144,7 @@ void RendererVulkan::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) {
149 const Layout::FramebufferLayout layout = render_window.GetFramebufferLayout(); 144 const Layout::FramebufferLayout layout = render_window.GetFramebufferLayout();
150 swapchain.Create(layout.width, layout.height, is_srgb); 145 swapchain.Create(layout.width, layout.height, is_srgb);
151 }; 146 };
152 if (swapchain.IsSubOptimal() || swapchain.HasColorSpaceChanged(is_srgb)) { 147 if (swapchain.NeedsRecreation(is_srgb)) {
153 recreate_swapchain(); 148 recreate_swapchain();
154 } 149 }
155 bool is_outdated; 150 bool is_outdated;
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
index 7c0f91007..11cd41ad7 100644
--- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
+++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
@@ -507,8 +507,9 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) {
507 vertex_attributes.push_back({ 507 vertex_attributes.push_back({
508 .location = static_cast<u32>(index), 508 .location = static_cast<u32>(index),
509 .binding = 0, 509 .binding = 0,
510 .format = type == 1 ? VK_FORMAT_R32_SFLOAT 510 .format = type == 1 ? VK_FORMAT_R32_SFLOAT
511 : type == 2 ? VK_FORMAT_R32_SINT : VK_FORMAT_R32_UINT, 511 : type == 2 ? VK_FORMAT_R32_SINT
512 : VK_FORMAT_R32_UINT,
512 .offset = 0, 513 .offset = 0,
513 }); 514 });
514 } 515 }
diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h
index bd22e4e83..85fc1712f 100644
--- a/src/video_core/renderer_vulkan/vk_scheduler.h
+++ b/src/video_core/renderer_vulkan/vk_scheduler.h
@@ -212,7 +212,6 @@ private:
212 vk::CommandBuffer current_cmdbuf; 212 vk::CommandBuffer current_cmdbuf;
213 213
214 std::unique_ptr<CommandChunk> chunk; 214 std::unique_ptr<CommandChunk> chunk;
215 std::jthread worker_thread;
216 215
217 State state; 216 State state;
218 217
@@ -226,6 +225,7 @@ private:
226 std::mutex work_mutex; 225 std::mutex work_mutex;
227 std::condition_variable_any work_cv; 226 std::condition_variable_any work_cv;
228 std::condition_variable wait_cv; 227 std::condition_variable wait_cv;
228 std::jthread worker_thread;
229}; 229};
230 230
231} // namespace Vulkan 231} // namespace Vulkan
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp
index aadf03cb0..8972a6921 100644
--- a/src/video_core/renderer_vulkan/vk_swapchain.cpp
+++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp
@@ -9,6 +9,7 @@
9 9
10#include "common/assert.h" 10#include "common/assert.h"
11#include "common/logging/log.h" 11#include "common/logging/log.h"
12#include "common/settings.h"
12#include "core/core.h" 13#include "core/core.h"
13#include "core/frontend/framebuffer_layout.h" 14#include "core/frontend/framebuffer_layout.h"
14#include "video_core/renderer_vulkan/vk_scheduler.h" 15#include "video_core/renderer_vulkan/vk_scheduler.h"
@@ -36,8 +37,19 @@ VkSurfaceFormatKHR ChooseSwapSurfaceFormat(vk::Span<VkSurfaceFormatKHR> formats)
36 37
37VkPresentModeKHR ChooseSwapPresentMode(vk::Span<VkPresentModeKHR> modes) { 38VkPresentModeKHR ChooseSwapPresentMode(vk::Span<VkPresentModeKHR> modes) {
38 // Mailbox doesn't lock the application like fifo (vsync), prefer it 39 // Mailbox doesn't lock the application like fifo (vsync), prefer it
39 const auto found = std::find(modes.begin(), modes.end(), VK_PRESENT_MODE_MAILBOX_KHR); 40 const auto found_mailbox = std::find(modes.begin(), modes.end(), VK_PRESENT_MODE_MAILBOX_KHR);
40 return found != modes.end() ? *found : VK_PRESENT_MODE_FIFO_KHR; 41 if (found_mailbox != modes.end()) {
42 return VK_PRESENT_MODE_MAILBOX_KHR;
43 }
44 if (Settings::values.disable_fps_limit.GetValue()) {
45 // FIFO present mode locks the framerate to the monitor's refresh rate,
46 // Find an alternative to surpass this limitation if FPS is unlocked.
47 const auto found_imm = std::find(modes.begin(), modes.end(), VK_PRESENT_MODE_IMMEDIATE_KHR);
48 if (found_imm != modes.end()) {
49 return VK_PRESENT_MODE_IMMEDIATE_KHR;
50 }
51 }
52 return VK_PRESENT_MODE_FIFO_KHR;
41} 53}
42 54
43VkExtent2D ChooseSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities, u32 width, u32 height) { 55VkExtent2D ChooseSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities, u32 width, u32 height) {
@@ -143,7 +155,7 @@ void VKSwapchain::CreateSwapchain(const VkSurfaceCapabilitiesKHR& capabilities,
143 const auto present_modes{physical_device.GetSurfacePresentModesKHR(surface)}; 155 const auto present_modes{physical_device.GetSurfacePresentModesKHR(surface)};
144 156
145 const VkSurfaceFormatKHR surface_format{ChooseSwapSurfaceFormat(formats)}; 157 const VkSurfaceFormatKHR surface_format{ChooseSwapSurfaceFormat(formats)};
146 const VkPresentModeKHR present_mode{ChooseSwapPresentMode(present_modes)}; 158 present_mode = ChooseSwapPresentMode(present_modes);
147 159
148 u32 requested_image_count{capabilities.minImageCount + 1}; 160 u32 requested_image_count{capabilities.minImageCount + 1};
149 if (capabilities.maxImageCount > 0 && requested_image_count > capabilities.maxImageCount) { 161 if (capabilities.maxImageCount > 0 && requested_image_count > capabilities.maxImageCount) {
@@ -196,6 +208,7 @@ void VKSwapchain::CreateSwapchain(const VkSurfaceCapabilitiesKHR& capabilities,
196 208
197 extent = swapchain_ci.imageExtent; 209 extent = swapchain_ci.imageExtent;
198 current_srgb = srgb; 210 current_srgb = srgb;
211 current_fps_unlocked = Settings::values.disable_fps_limit.GetValue();
199 212
200 images = swapchain.GetImages(); 213 images = swapchain.GetImages();
201 image_count = static_cast<u32>(images.size()); 214 image_count = static_cast<u32>(images.size());
@@ -248,4 +261,14 @@ void VKSwapchain::Destroy() {
248 swapchain.reset(); 261 swapchain.reset();
249} 262}
250 263
264bool VKSwapchain::HasFpsUnlockChanged() const {
265 return current_fps_unlocked != Settings::values.disable_fps_limit.GetValue();
266}
267
268bool VKSwapchain::NeedsPresentModeUpdate() const {
269 // Mailbox present mode is the ideal for all scenarios. If it is not available,
270 // A different present mode is needed to support unlocked FPS above the monitor's refresh rate.
271 return present_mode != VK_PRESENT_MODE_MAILBOX_KHR && HasFpsUnlockChanged();
272}
273
251} // namespace Vulkan 274} // namespace Vulkan
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.h b/src/video_core/renderer_vulkan/vk_swapchain.h
index 5bce41e21..61a6d959e 100644
--- a/src/video_core/renderer_vulkan/vk_swapchain.h
+++ b/src/video_core/renderer_vulkan/vk_swapchain.h
@@ -33,6 +33,11 @@ public:
33 /// Presents the rendered image to the swapchain. 33 /// Presents the rendered image to the swapchain.
34 void Present(VkSemaphore render_semaphore); 34 void Present(VkSemaphore render_semaphore);
35 35
36 /// Returns true when the swapchain needs to be recreated.
37 bool NeedsRecreation(bool is_srgb) const {
38 return HasColorSpaceChanged(is_srgb) || IsSubOptimal() || NeedsPresentModeUpdate();
39 }
40
36 /// Returns true when the color space has changed. 41 /// Returns true when the color space has changed.
37 bool HasColorSpaceChanged(bool is_srgb) const { 42 bool HasColorSpaceChanged(bool is_srgb) const {
38 return current_srgb != is_srgb; 43 return current_srgb != is_srgb;
@@ -84,6 +89,10 @@ private:
84 89
85 void Destroy(); 90 void Destroy();
86 91
92 bool HasFpsUnlockChanged() const;
93
94 bool NeedsPresentModeUpdate() const;
95
87 const VkSurfaceKHR surface; 96 const VkSurfaceKHR surface;
88 const Device& device; 97 const Device& device;
89 VKScheduler& scheduler; 98 VKScheduler& scheduler;
@@ -102,8 +111,10 @@ private:
102 111
103 VkFormat image_view_format{}; 112 VkFormat image_view_format{};
104 VkExtent2D extent{}; 113 VkExtent2D extent{};
114 VkPresentModeKHR present_mode{};
105 115
106 bool current_srgb{}; 116 bool current_srgb{};
117 bool current_fps_unlocked{};
107 bool is_outdated{}; 118 bool is_outdated{};
108 bool is_suboptimal{}; 119 bool is_suboptimal{};
109}; 120};
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index ff979a7ac..3b87640b5 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -127,7 +127,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) {
127 const auto format_info = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, false, format); 127 const auto format_info = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, false, format);
128 VkImageCreateFlags flags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT; 128 VkImageCreateFlags flags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
129 if (info.type == ImageType::e2D && info.resources.layers >= 6 && 129 if (info.type == ImageType::e2D && info.resources.layers >= 6 &&
130 info.size.width == info.size.height) { 130 info.size.width == info.size.height && !device.HasBrokenCubeImageCompability()) {
131 flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT; 131 flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
132 } 132 }
133 if (info.type == ImageType::e3D) { 133 if (info.type == ImageType::e3D) {
diff --git a/src/video_core/texture_cache/slot_vector.h b/src/video_core/texture_cache/slot_vector.h
index 74cd3c9d8..50df06409 100644
--- a/src/video_core/texture_cache/slot_vector.h
+++ b/src/video_core/texture_cache/slot_vector.h
@@ -31,8 +31,8 @@ struct SlotId {
31}; 31};
32 32
33template <class T> 33template <class T>
34requires std::is_nothrow_move_assignable_v<T>&& 34requires std::is_nothrow_move_assignable_v<T> && std::is_nothrow_move_constructible_v<T>
35 std::is_nothrow_move_constructible_v<T> class SlotVector { 35class SlotVector {
36public: 36public:
37 class Iterator { 37 class Iterator {
38 friend SlotVector<T>; 38 friend SlotVector<T>;
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp
index c2ec9f76a..6388ed2eb 100644
--- a/src/video_core/vulkan_common/vulkan_device.cpp
+++ b/src/video_core/vulkan_common/vulkan_device.cpp
@@ -588,22 +588,27 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
588 ext_extended_dynamic_state = false; 588 ext_extended_dynamic_state = false;
589 } 589 }
590 } 590 }
591
592 sets_per_pool = 64; 591 sets_per_pool = 64;
593 if (driver_id == VK_DRIVER_ID_AMD_PROPRIETARY || driver_id == VK_DRIVER_ID_AMD_OPEN_SOURCE) { 592
593 const bool is_amd =
594 driver_id == VK_DRIVER_ID_AMD_PROPRIETARY || driver_id == VK_DRIVER_ID_AMD_OPEN_SOURCE;
595 if (is_amd) {
594 // AMD drivers need a higher amount of Sets per Pool in certain circunstances like in XC2. 596 // AMD drivers need a higher amount of Sets per Pool in certain circunstances like in XC2.
595 sets_per_pool = 96; 597 sets_per_pool = 96;
596 } 598 // Disable VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT on AMD GCN4 and lower as it is broken.
597
598 const bool is_amd = driver_id == VK_DRIVER_ID_AMD_PROPRIETARY ||
599 driver_id == VK_DRIVER_ID_MESA_RADV ||
600 driver_id == VK_DRIVER_ID_AMD_OPEN_SOURCE;
601 if (ext_sampler_filter_minmax && is_amd) {
602 // Disable ext_sampler_filter_minmax on AMD GCN4 and lower as it is broken.
603 if (!is_float16_supported) { 599 if (!is_float16_supported) {
604 LOG_WARNING( 600 LOG_WARNING(
605 Render_Vulkan, 601 Render_Vulkan,
606 "Blacklisting AMD GCN4 and lower for VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME"); 602 "AMD GCN4 and earlier do not properly support VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT");
603 has_broken_cube_compatibility = true;
604 }
605 }
606 const bool is_amd_or_radv = is_amd || driver_id == VK_DRIVER_ID_MESA_RADV;
607 if (ext_sampler_filter_minmax && is_amd_or_radv) {
608 // Disable ext_sampler_filter_minmax on AMD GCN4 and lower as it is broken.
609 if (!is_float16_supported) {
610 LOG_WARNING(Render_Vulkan,
611 "Blacklisting AMD GCN4 and earlier for VK_EXT_sampler_filter_minmax");
607 ext_sampler_filter_minmax = false; 612 ext_sampler_filter_minmax = false;
608 } 613 }
609 } 614 }
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h
index bc180a32a..d9e74f1aa 100644
--- a/src/video_core/vulkan_common/vulkan_device.h
+++ b/src/video_core/vulkan_common/vulkan_device.h
@@ -309,6 +309,11 @@ public:
309 return has_renderdoc || has_nsight_graphics; 309 return has_renderdoc || has_nsight_graphics;
310 } 310 }
311 311
312 /// Returns true when the device does not properly support cube compatibility.
313 bool HasBrokenCubeImageCompability() const {
314 return has_broken_cube_compatibility;
315 }
316
312 /// Returns the vendor name reported from Vulkan. 317 /// Returns the vendor name reported from Vulkan.
313 std::string_view GetVendorName() const { 318 std::string_view GetVendorName() const {
314 return vendor_name; 319 return vendor_name;
@@ -417,6 +422,7 @@ private:
417 bool ext_conservative_rasterization{}; ///< Support for VK_EXT_conservative_rasterization. 422 bool ext_conservative_rasterization{}; ///< Support for VK_EXT_conservative_rasterization.
418 bool ext_provoking_vertex{}; ///< Support for VK_EXT_provoking_vertex. 423 bool ext_provoking_vertex{}; ///< Support for VK_EXT_provoking_vertex.
419 bool nv_device_diagnostics_config{}; ///< Support for VK_NV_device_diagnostics_config. 424 bool nv_device_diagnostics_config{}; ///< Support for VK_NV_device_diagnostics_config.
425 bool has_broken_cube_compatibility{}; ///< Has broken cube compatiblity bit
420 bool has_renderdoc{}; ///< Has RenderDoc attached 426 bool has_renderdoc{}; ///< Has RenderDoc attached
421 bool has_nsight_graphics{}; ///< Has Nsight Graphics attached 427 bool has_nsight_graphics{}; ///< Has Nsight Graphics attached
422 428
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index 27b67fd9e..b5796a8fc 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -562,7 +562,11 @@ void Config::ReadControlValues() {
562 ReadTouchscreenValues(); 562 ReadTouchscreenValues();
563 ReadMotionTouchValues(); 563 ReadMotionTouchValues();
564 564
565#ifdef _WIN32
565 ReadBasicSetting(Settings::values.enable_raw_input); 566 ReadBasicSetting(Settings::values.enable_raw_input);
567#else
568 Settings::values.enable_raw_input = false;
569#endif
566 ReadBasicSetting(Settings::values.emulate_analog_keyboard); 570 ReadBasicSetting(Settings::values.emulate_analog_keyboard);
567 Settings::values.mouse_panning = false; 571 Settings::values.mouse_panning = false;
568 ReadBasicSetting(Settings::values.mouse_panning_sensitivity); 572 ReadBasicSetting(Settings::values.mouse_panning_sensitivity);
diff --git a/src/yuzu/configuration/configure_debug.ui b/src/yuzu/configuration/configure_debug.ui
index 3fe9ff7de..b884a56b0 100644
--- a/src/yuzu/configuration/configure_debug.ui
+++ b/src/yuzu/configuration/configure_debug.ui
@@ -2,85 +2,55 @@
2<ui version="4.0"> 2<ui version="4.0">
3 <class>ConfigureDebug</class> 3 <class>ConfigureDebug</class>
4 <widget class="QWidget" name="ConfigureDebug"> 4 <widget class="QWidget" name="ConfigureDebug">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>400</width>
10 <height>777</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>Form</string>
15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout_1"> 5 <layout class="QVBoxLayout" name="verticalLayout_1">
17 <item> 6 <item>
18 <widget class="QGroupBox" name="groupBox_2"> 7 <widget class="QGroupBox" name="groupBox_2">
19 <property name="title"> 8 <property name="title">
20 <string>Logging</string> 9 <string>Logging</string>
21 </property> 10 </property>
22 <layout class="QVBoxLayout" name="verticalLayout_4"> 11 <layout class="QGridLayout" name="gridLayout_1">
23 <item> 12 <item row="0" column="0" colspan="2">
24 <layout class="QHBoxLayout" name="horizontalLayout_2"> 13 <layout class="QHBoxLayout" name="horizontalLayout_1">
25 <item> 14 <item>
26 <widget class="QLabel" name="label_1"> 15 <widget class="QLabel" name="label_1">
27 <property name="text"> 16 <property name="text">
28 <string>Global Log Filter</string> 17 <string>Global Log Filter</string>
18 </property>
19 </widget>
20 </item>
21 <item>
22 <widget class="QLineEdit" name="log_filter_edit"/>
23 </item>
24 </layout>
25 </item>
26 <item row="1" column="0">
27 <widget class="QCheckBox" name="toggle_console">
28 <property name="text">
29 <string>Show Log in Console</string>
30 </property>
31 </widget>
32 </item>
33 <item row="1" column="1">
34 <widget class="QPushButton" name="open_log_button">
35 <property name="text">
36 <string>Open Log Location</string>
37 </property>
38 </widget>
39 </item>
40 <item row="2" column="0">
41 <widget class="QCheckBox" name="extended_logging">
42 <property name="enabled">
43 <bool>true</bool>
29 </property> 44 </property>
30 </widget> 45 <property name="toolTip">
31 </item> 46 <string>When checked, the max size of the log increases from 100 MB to 1 GB</string>
32 <item>
33 <widget class="QLineEdit" name="log_filter_edit"/>
34 </item>
35 </layout>
36 </item>
37 <item>
38 <layout class="QHBoxLayout" name="horizontalLayout_3">
39 <item>
40 <widget class="QCheckBox" name="toggle_console">
41 <property name="text">
42 <string>Show Log in Console</string>
43 </property> 47 </property>
44 </widget>
45 </item>
46 <item>
47 <widget class="QPushButton" name="open_log_button">
48 <property name="text"> 48 <property name="text">
49 <string>Open Log Location</string> 49 <string>Enable Extended Logging**</string>
50 </property> 50 </property>
51 </widget> 51 </widget>
52 </item> 52 </item>
53 </layout> 53 </layout>
54 </item>
55 <item>
56 <widget class="QCheckBox" name="extended_logging">
57 <property name="enabled">
58 <bool>true</bool>
59 </property>
60 <property name="toolTip">
61 <string>When checked, the max size of the log increases from 100 MB to 1 GB</string>
62 </property>
63 <property name="text">
64 <string>Enable Extended Logging</string>
65 </property>
66 </widget>
67 </item>
68 <item>
69 <widget class="QLabel" name="label_2">
70 <property name="font">
71 <font>
72 <italic>true</italic>
73 </font>
74 </property>
75 <property name="text">
76 <string>This will be reset automatically when yuzu closes.</string>
77 </property>
78 <property name="indent">
79 <number>20</number>
80 </property>
81 </widget>
82 </item>
83 </layout>
84 </widget> 54 </widget>
85 </item> 55 </item>
86 <item> 56 <item>
@@ -111,7 +81,7 @@
111 <property name="title"> 81 <property name="title">
112 <string>Graphics</string> 82 <string>Graphics</string>
113 </property> 83 </property>
114 <layout class="QGridLayout" name="gridLayout_3"> 84 <layout class="QGridLayout" name="gridLayout_2">
115 <item row="0" column="0"> 85 <item row="0" column="0">
116 <widget class="QCheckBox" name="enable_graphics_debugging"> 86 <widget class="QCheckBox" name="enable_graphics_debugging">
117 <property name="enabled"> 87 <property name="enabled">
@@ -176,33 +146,18 @@
176 <property name="title"> 146 <property name="title">
177 <string>Debugging</string> 147 <string>Debugging</string>
178 </property> 148 </property>
179 <layout class="QVBoxLayout" name="verticalLayout_7"> 149 <layout class="QGridLayout" name="gridLayout_3">
180 <item> 150 <item row="0" column="0">
181 <widget class="QCheckBox" name="fs_access_log"> 151 <widget class="QCheckBox" name="fs_access_log">
182 <property name="text"> 152 <property name="text">
183 <string>Enable FS Access Log</string> 153 <string>Enable FS Access Log</string>
184 </property> 154 </property>
185 </widget> 155 </widget>
186 </item> 156 </item>
187 <item> 157 <item row="1" column="0">
188 <widget class="QCheckBox" name="reporting_services"> 158 <widget class="QCheckBox" name="reporting_services">
189 <property name="text"> 159 <property name="text">
190 <string>Enable Verbose Reporting Services</string> 160 <string>Enable Verbose Reporting Services**</string>
191 </property>
192 </widget>
193 </item>
194 <item>
195 <widget class="QLabel" name="label_4">
196 <property name="font">
197 <font>
198 <italic>true</italic>
199 </font>
200 </property>
201 <property name="text">
202 <string>This will be reset automatically when yuzu closes.</string>
203 </property>
204 <property name="indent">
205 <number>20</number>
206 </property> 161 </property>
207 </widget> 162 </widget>
208 </item> 163 </item>
@@ -214,47 +169,32 @@
214 <property name="title"> 169 <property name="title">
215 <string>Advanced</string> 170 <string>Advanced</string>
216 </property> 171 </property>
217 <layout class="QVBoxLayout" name="verticalLayout_8"> 172 <layout class="QGridLayout" name="gridLayout_4">
218 <item> 173 <item> row="0" column="0">
219 <widget class="QCheckBox" name="quest_flag"> 174 <widget class="QCheckBox" name="quest_flag">
220 <property name="text"> 175 <property name="text">
221 <string>Kiosk (Quest) Mode</string> 176 <string>Kiosk (Quest) Mode</string>
222 </property> 177 </property>
223 </widget> 178 </widget>
224 </item> 179 </item>
225 <item> 180 <item row="1" column="0">
226 <widget class="QCheckBox" name="enable_cpu_debugging"> 181 <widget class="QCheckBox" name="enable_cpu_debugging">
227 <property name="text"> 182 <property name="text">
228 <string>Enable CPU Debugging</string> 183 <string>Enable CPU Debugging</string>
229 </property> 184 </property>
230 </widget> 185 </widget>
231 </item> 186 </item>
232 <item> 187 <item row="2" column="0">
233 <widget class="QCheckBox" name="use_debug_asserts"> 188 <widget class="QCheckBox" name="use_debug_asserts">
234 <property name="text"> 189 <property name="text">
235 <string>Enable Debug Asserts</string> 190 <string>Enable Debug Asserts</string>
236 </property> 191 </property>
237 </widget> 192 </widget>
238 </item> 193 </item>
239 <item> 194 <item row="0" column="1">
240 <widget class="QCheckBox" name="use_auto_stub"> 195 <widget class="QCheckBox" name="use_auto_stub">
241 <property name="text"> 196 <property name="text">
242 <string>Enable Auto-Stub</string> 197 <string>Enable Auto-Stub**</string>
243 </property>
244 </widget>
245 </item>
246 <item>
247 <widget class="QLabel" name="label_5">
248 <property name="font">
249 <font>
250 <italic>true</italic>
251 </font>
252 </property>
253 <property name="text">
254 <string>This will be reset automatically when yuzu closes.</string>
255 </property>
256 <property name="indent">
257 <number>20</number>
258 </property> 198 </property>
259 </widget> 199 </widget>
260 </item> 200 </item>
@@ -262,20 +202,19 @@
262 </widget> 202 </widget>
263 </item> 203 </item>
264 <item> 204 <item>
265 <spacer name="verticalSpacer"> 205 <widget class="QLabel" name="label_5">
266 <property name="orientation"> 206 <property name="font">
267 <enum>Qt::Vertical</enum> 207 <font>
208 <italic>true</italic>
209 </font>
268 </property> 210 </property>
269 <property name="sizeType"> 211 <property name="text">
270 <enum>QSizePolicy::Expanding</enum> 212 <string>**This will be reset automatically when yuzu closes.</string>
271 </property> 213 </property>
272 <property name="sizeHint" stdset="0"> 214 <property name="indent">
273 <size> 215 <number>20</number>
274 <width>20</width>
275 <height>40</height>
276 </size>
277 </property> 216 </property>
278 </spacer> 217 </widget>
279 </item> 218 </item>
280 </layout> 219 </layout>
281 </widget> 220 </widget>
diff --git a/src/yuzu/configuration/configure_input_advanced.cpp b/src/yuzu/configuration/configure_input_advanced.cpp
index d20fd86b6..b30f09013 100644
--- a/src/yuzu/configuration/configure_input_advanced.cpp
+++ b/src/yuzu/configuration/configure_input_advanced.cpp
@@ -88,6 +88,10 @@ ConfigureInputAdvanced::ConfigureInputAdvanced(QWidget* parent)
88 connect(ui->buttonMotionTouch, &QPushButton::clicked, this, 88 connect(ui->buttonMotionTouch, &QPushButton::clicked, this,
89 &ConfigureInputAdvanced::CallMotionTouchConfigDialog); 89 &ConfigureInputAdvanced::CallMotionTouchConfigDialog);
90 90
91#ifndef _WIN32
92 ui->enable_raw_input->setVisible(false);
93#endif
94
91 LoadConfiguration(); 95 LoadConfiguration();
92} 96}
93 97
diff --git a/src/yuzu/configuration/configure_profile_manager.cpp b/src/yuzu/configuration/configure_profile_manager.cpp
index ac849b01d..136614bf8 100644
--- a/src/yuzu/configuration/configure_profile_manager.cpp
+++ b/src/yuzu/configuration/configure_profile_manager.cpp
@@ -76,7 +76,7 @@ QString GetProfileUsernameFromUser(QWidget* parent, const QString& description_t
76} 76}
77} // Anonymous namespace 77} // Anonymous namespace
78 78
79ConfigureProfileManager ::ConfigureProfileManager(QWidget* parent) 79ConfigureProfileManager::ConfigureProfileManager(QWidget* parent)
80 : QWidget(parent), ui(new Ui::ConfigureProfileManager), 80 : QWidget(parent), ui(new Ui::ConfigureProfileManager),
81 profile_manager(std::make_unique<Service::Account::ProfileManager>()) { 81 profile_manager(std::make_unique<Service::Account::ProfileManager>()) {
82 ui->setupUi(this); 82 ui->setupUi(this);
diff --git a/src/yuzu/configuration/configure_tas.ui b/src/yuzu/configuration/configure_tas.ui
index 8a3ecb834..95575ed9d 100644
--- a/src/yuzu/configuration/configure_tas.ui
+++ b/src/yuzu/configuration/configure_tas.ui
@@ -2,37 +2,23 @@
2<ui version="4.0"> 2<ui version="4.0">
3 <class>ConfigureTas</class> 3 <class>ConfigureTas</class>
4 <widget class="QDialog" name="ConfigureTas"> 4 <widget class="QDialog" name="ConfigureTas">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>800</width>
10 <height>300</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>Dialog</string>
15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout_1"> 5 <layout class="QVBoxLayout" name="verticalLayout_1">
17 <item> 6 <item>
18 <layout class="QHBoxLayout" name="horizontalLayout"> 7 <layout class="QHBoxLayout" name="horizontalLayout_1">
19 <item> 8 <item>
20 <widget class="QGroupBox" name="groupBox"> 9 <widget class="QGroupBox" name="groupBox_1">
21 <property name="title"> 10 <property name="title">
22 <string>TAS</string> 11 <string>TAS</string>
23 </property> 12 </property>
24 <layout class="QGridLayout" name="gridLayout"> 13 <layout class="QGridLayout" name="gridLayout_1">
25 <item row="0" column="0" colspan="1"> 14 <item row="0" column="0" colspan="4">
26 <widget class="QLabel" name="label_1"> 15 <widget class="QLabel" name="label_1">
27 <property name="text"> 16 <property name="text">
28 <string>Reads controller input from scripts in the same format as TAS-nx scripts. For a more detailed explanation please consult the FAQ on the yuzu website.</string> 17 <string>Reads controller input from scripts in the same format as TAS-nx scripts.&lt;br/&gt;For a more detailed explanation please consult the FAQ on the yuzu website.</string>
29 </property>
30 <property name="wordWrap">
31 <bool>true</bool>
32 </property> 18 </property>
33 </widget> 19 </widget>
34 </item> 20 </item>
35 <item row="1" column="0" colspan="1"> 21 <item row="1" column="0" colspan="4">
36 <widget class="QLabel" name="label_2"> 22 <widget class="QLabel" name="label_2">
37 <property name="text"> 23 <property name="text">
38 <string>To check which hotkeys control the playback/recording, please refer to the Hotkey settings (General -> Hotkeys).</string> 24 <string>To check which hotkeys control the playback/recording, please refer to the Hotkey settings (General -> Hotkeys).</string>
@@ -42,10 +28,10 @@
42 </property> 28 </property>
43 </widget> 29 </widget>
44 </item> 30 </item>
45 <item row="2" column="0" colspan="1"> 31 <item row="2" column="0" colspan="4">
46 <widget class="QLabel" name="label_2"> 32 <widget class="QLabel" name="label_3">
47 <property name="text"> 33 <property name="text">
48 <string>WARNING: This is an experimental feature. It will not play back scripts frame perfectly with the current, imperfect syncing method.</string> 34 <string>WARNING: This is an experimental feature.&lt;br/&gt;It will not play back scripts frame perfectly with the current, imperfect syncing method.</string>
49 </property> 35 </property>
50 <property name="wordWrap"> 36 <property name="wordWrap">
51 <bool>true</bool> 37 <bool>true</bool>
@@ -58,13 +44,13 @@
58 </layout> 44 </layout>
59 </item> 45 </item>
60 <item> 46 <item>
61 <layout class="QHBoxLayout" name="horizontalLayout"> 47 <layout class="QHBoxLayout" name="horizontalLayout_2">
62 <item> 48 <item>
63 <widget class="QGroupBox" name="groupBox"> 49 <widget class="QGroupBox" name="groupBox_2">
64 <property name="title"> 50 <property name="title">
65 <string>Settings</string> 51 <string>Settings</string>
66 </property> 52 </property>
67 <layout class="QGridLayout" name="gridLayout"> 53 <layout class="QGridLayout" name="gridLayout_2">
68 <item row="0" column="0" colspan="4"> 54 <item row="0" column="0" colspan="4">
69 <widget class="QCheckBox" name="tas_enable"> 55 <widget class="QCheckBox" name="tas_enable">
70 <property name="text"> 56 <property name="text">
@@ -102,15 +88,15 @@
102 </layout> 88 </layout>
103 </item> 89 </item>
104 <item> 90 <item>
105 <layout class="QHBoxLayout" name="horizontalLayout"> 91 <layout class="QHBoxLayout" name="horizontalLayout_3">
106 <item> 92 <item>
107 <widget class="QGroupBox" name="groupBox"> 93 <widget class="QGroupBox" name="groupBox_3">
108 <property name="title"> 94 <property name="title">
109 <string>Script Directory</string> 95 <string>Script Directory</string>
110 </property> 96 </property>
111 <layout class="QGridLayout" name="gridLayout"> 97 <layout class="QGridLayout" name="gridLayout_3">
112 <item row="0" column="0"> 98 <item row="0" column="0">
113 <widget class="QLabel" name="label"> 99 <widget class="QLabel" name="label_4">
114 <property name="text"> 100 <property name="text">
115 <string>Path</string> 101 <string>Path</string>
116 </property> 102 </property>
@@ -126,22 +112,6 @@
126 <item row="0" column="2"> 112 <item row="0" column="2">
127 <widget class="QLineEdit" name="tas_path_edit"/> 113 <widget class="QLineEdit" name="tas_path_edit"/>
128 </item> 114 </item>
129 <item row="0" column="1">
130 <spacer name="horizontalSpacer">
131 <property name="orientation">
132 <enum>Qt::Horizontal</enum>
133 </property>
134 <property name="sizeType">
135 <enum>QSizePolicy::Maximum</enum>
136 </property>
137 <property name="sizeHint" stdset="0">
138 <size>
139 <width>60</width>
140 <height>20</height>
141 </size>
142 </property>
143 </spacer>
144 </item>
145 </layout> 115 </layout>
146 </widget> 116 </widget>
147 </item> 117 </item>