summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/k_thread.cpp6
-rw-r--r--src/core/hle/service/acc/acc.cpp34
-rw-r--r--src/core/hle/service/acc/acc.h1
-rw-r--r--src/core/hle/service/acc/acc_u0.cpp2
-rw-r--r--src/core/hle/service/acc/profile_manager.cpp25
-rw-r--r--src/core/hle/service/acc/profile_manager.h3
-rw-r--r--src/core/hle/service/sm/sm.cpp7
-rw-r--r--src/core/hle/service/sm/sm_controller.cpp33
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp6
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.h1
-rw-r--r--src/video_core/renderer_vulkan/vk_scheduler.h4
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp27
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.h11
-rw-r--r--src/yuzu/main.ui1
14 files changed, 99 insertions, 62 deletions
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp
index d57b42fdf..cc88d08f0 100644
--- a/src/core/hle/kernel/k_thread.cpp
+++ b/src/core/hle/kernel/k_thread.cpp
@@ -1185,8 +1185,10 @@ void KThread::RequestDummyThreadWait() {
1185} 1185}
1186 1186
1187void KThread::DummyThreadBeginWait() { 1187void KThread::DummyThreadBeginWait() {
1188 ASSERT(this->IsDummyThread()); 1188 if (!this->IsDummyThread() || kernel.IsPhantomModeForSingleCore()) {
1189 ASSERT(!kernel.IsPhantomModeForSingleCore()); 1189 // Occurs in single core mode.
1190 return;
1191 }
1190 1192
1191 // Block until runnable is no longer false. 1193 // Block until runnable is no longer false.
1192 dummy_thread_runnable.wait(false); 1194 dummy_thread_runnable.wait(false);
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index bb838e285..85a3f0802 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -512,10 +512,11 @@ protected:
512 512
513class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { 513class IManagerForApplication final : public ServiceFramework<IManagerForApplication> {
514public: 514public:
515 explicit IManagerForApplication(Core::System& system_, Common::UUID user_id_) 515 explicit IManagerForApplication(Core::System& system_,
516 const std::shared_ptr<ProfileManager>& profile_manager_)
516 : ServiceFramework{system_, "IManagerForApplication"}, 517 : ServiceFramework{system_, "IManagerForApplication"},
517 ensure_token_id{std::make_shared<EnsureTokenIdCacheAsyncInterface>(system)}, 518 ensure_token_id{std::make_shared<EnsureTokenIdCacheAsyncInterface>(system)},
518 user_id{user_id_} { 519 profile_manager{profile_manager_} {
519 // clang-format off 520 // clang-format off
520 static const FunctionInfo functions[] = { 521 static const FunctionInfo functions[] = {
521 {0, &IManagerForApplication::CheckAvailability, "CheckAvailability"}, 522 {0, &IManagerForApplication::CheckAvailability, "CheckAvailability"},
@@ -545,7 +546,7 @@ private:
545 546
546 IPC::ResponseBuilder rb{ctx, 4}; 547 IPC::ResponseBuilder rb{ctx, 4};
547 rb.Push(ResultSuccess); 548 rb.Push(ResultSuccess);
548 rb.PushRaw<u64>(user_id.Hash()); 549 rb.PushRaw<u64>(profile_manager->GetLastOpenedUser().Hash());
549 } 550 }
550 551
551 void EnsureIdTokenCacheAsync(Kernel::HLERequestContext& ctx) { 552 void EnsureIdTokenCacheAsync(Kernel::HLERequestContext& ctx) {
@@ -575,17 +576,20 @@ private:
575 576
576 IPC::ResponseBuilder rb{ctx, 4}; 577 IPC::ResponseBuilder rb{ctx, 4};
577 rb.Push(ResultSuccess); 578 rb.Push(ResultSuccess);
578 rb.PushRaw<u64>(user_id.Hash()); 579 rb.PushRaw<u64>(profile_manager->GetLastOpenedUser().Hash());
579 } 580 }
580 581
581 void StoreOpenContext(Kernel::HLERequestContext& ctx) { 582 void StoreOpenContext(Kernel::HLERequestContext& ctx) {
582 LOG_WARNING(Service_ACC, "(STUBBED) called"); 583 LOG_DEBUG(Service_ACC, "called");
584
585 profile_manager->StoreOpenedUsers();
586
583 IPC::ResponseBuilder rb{ctx, 2}; 587 IPC::ResponseBuilder rb{ctx, 2};
584 rb.Push(ResultSuccess); 588 rb.Push(ResultSuccess);
585 } 589 }
586 590
587 std::shared_ptr<EnsureTokenIdCacheAsyncInterface> ensure_token_id{}; 591 std::shared_ptr<EnsureTokenIdCacheAsyncInterface> ensure_token_id{};
588 Common::UUID user_id{}; 592 std::shared_ptr<ProfileManager> profile_manager;
589}; 593};
590 594
591// 6.0.0+ 595// 6.0.0+
@@ -790,7 +794,7 @@ void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestCo
790 LOG_DEBUG(Service_ACC, "called"); 794 LOG_DEBUG(Service_ACC, "called");
791 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 795 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
792 rb.Push(ResultSuccess); 796 rb.Push(ResultSuccess);
793 rb.PushIpcInterface<IManagerForApplication>(system, profile_manager->GetLastOpenedUser()); 797 rb.PushIpcInterface<IManagerForApplication>(system, profile_manager);
794} 798}
795 799
796void Module::Interface::IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx) { 800void Module::Interface::IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx) {
@@ -849,22 +853,10 @@ void Module::Interface::ListQualifiedUsers(Kernel::HLERequestContext& ctx) {
849 rb.Push(ResultSuccess); 853 rb.Push(ResultSuccess);
850} 854}
851 855
852void Module::Interface::LoadOpenContext(Kernel::HLERequestContext& ctx) {
853 LOG_WARNING(Service_ACC, "(STUBBED) called");
854
855 // This is similar to GetBaasAccountManagerForApplication
856 // This command is used concurrently with ListOpenContextStoredUsers
857 // TODO: Find the differences between this and GetBaasAccountManagerForApplication
858 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
859 rb.Push(ResultSuccess);
860 rb.PushIpcInterface<IManagerForApplication>(system, profile_manager->GetLastOpenedUser());
861}
862
863void Module::Interface::ListOpenContextStoredUsers(Kernel::HLERequestContext& ctx) { 856void Module::Interface::ListOpenContextStoredUsers(Kernel::HLERequestContext& ctx) {
864 LOG_WARNING(Service_ACC, "(STUBBED) called"); 857 LOG_DEBUG(Service_ACC, "called");
865 858
866 // TODO(ogniK): Handle open contexts 859 ctx.WriteBuffer(profile_manager->GetStoredOpenedUsers());
867 ctx.WriteBuffer(profile_manager->GetOpenUsers());
868 IPC::ResponseBuilder rb{ctx, 2}; 860 IPC::ResponseBuilder rb{ctx, 2};
869 rb.Push(ResultSuccess); 861 rb.Push(ResultSuccess);
870} 862}
diff --git a/src/core/hle/service/acc/acc.h b/src/core/hle/service/acc/acc.h
index 1621e7c0a..9411b0b92 100644
--- a/src/core/hle/service/acc/acc.h
+++ b/src/core/hle/service/acc/acc.h
@@ -35,7 +35,6 @@ public:
35 void InitializeApplicationInfoV2(Kernel::HLERequestContext& ctx); 35 void InitializeApplicationInfoV2(Kernel::HLERequestContext& ctx);
36 void GetProfileEditor(Kernel::HLERequestContext& ctx); 36 void GetProfileEditor(Kernel::HLERequestContext& ctx);
37 void ListQualifiedUsers(Kernel::HLERequestContext& ctx); 37 void ListQualifiedUsers(Kernel::HLERequestContext& ctx);
38 void LoadOpenContext(Kernel::HLERequestContext& ctx);
39 void ListOpenContextStoredUsers(Kernel::HLERequestContext& ctx); 38 void ListOpenContextStoredUsers(Kernel::HLERequestContext& ctx);
40 void StoreSaveDataThumbnailApplication(Kernel::HLERequestContext& ctx); 39 void StoreSaveDataThumbnailApplication(Kernel::HLERequestContext& ctx);
41 void StoreSaveDataThumbnailSystem(Kernel::HLERequestContext& ctx); 40 void StoreSaveDataThumbnailSystem(Kernel::HLERequestContext& ctx);
diff --git a/src/core/hle/service/acc/acc_u0.cpp b/src/core/hle/service/acc/acc_u0.cpp
index 65023b8c2..54844bfe7 100644
--- a/src/core/hle/service/acc/acc_u0.cpp
+++ b/src/core/hle/service/acc/acc_u0.cpp
@@ -28,7 +28,7 @@ ACC_U0::ACC_U0(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager>
28 {110, &ACC_U0::StoreSaveDataThumbnailApplication, "StoreSaveDataThumbnail"}, 28 {110, &ACC_U0::StoreSaveDataThumbnailApplication, "StoreSaveDataThumbnail"},
29 {111, nullptr, "ClearSaveDataThumbnail"}, 29 {111, nullptr, "ClearSaveDataThumbnail"},
30 {120, nullptr, "CreateGuestLoginRequest"}, 30 {120, nullptr, "CreateGuestLoginRequest"},
31 {130, &ACC_U0::LoadOpenContext, "LoadOpenContext"}, // 5.0.0+ 31 {130, nullptr, "LoadOpenContext"}, // 5.0.0+
32 {131, &ACC_U0::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, // 6.0.0+ 32 {131, &ACC_U0::ListOpenContextStoredUsers, "ListOpenContextStoredUsers"}, // 6.0.0+
33 {140, &ACC_U0::InitializeApplicationInfoRestricted, "InitializeApplicationInfoRestricted"}, // 6.0.0+ 33 {140, &ACC_U0::InitializeApplicationInfoRestricted, "InitializeApplicationInfoRestricted"}, // 6.0.0+
34 {141, &ACC_U0::ListQualifiedUsers, "ListQualifiedUsers"}, // 6.0.0+ 34 {141, &ACC_U0::ListQualifiedUsers, "ListQualifiedUsers"}, // 6.0.0+
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp
index a58da4d5f..481e0d141 100644
--- a/src/core/hle/service/acc/profile_manager.cpp
+++ b/src/core/hle/service/acc/profile_manager.cpp
@@ -261,6 +261,31 @@ UUID ProfileManager::GetLastOpenedUser() const {
261 return last_opened_user; 261 return last_opened_user;
262} 262}
263 263
264/// Gets the list of stored opened users.
265UserIDArray ProfileManager::GetStoredOpenedUsers() const {
266 UserIDArray output{};
267 std::ranges::transform(stored_opened_profiles, output.begin(), [](const ProfileInfo& p) {
268 if (p.is_open)
269 return p.user_uuid;
270 return Common::InvalidUUID;
271 });
272 std::stable_partition(output.begin(), output.end(),
273 [](const UUID& uuid) { return uuid.IsValid(); });
274 return output;
275}
276
277/// Captures the opened users, which can be queried across process launches with
278/// ListOpenContextStoredUsers.
279void ProfileManager::StoreOpenedUsers() {
280 size_t profile_index{};
281 stored_opened_profiles = {};
282 std::for_each(profiles.begin(), profiles.end(), [&](const auto& profile) {
283 if (profile.is_open) {
284 stored_opened_profiles[profile_index++] = profile;
285 }
286 });
287}
288
264/// Return the users profile base and the unknown arbitary data. 289/// Return the users profile base and the unknown arbitary data.
265bool ProfileManager::GetProfileBaseAndData(std::optional<std::size_t> index, ProfileBase& profile, 290bool ProfileManager::GetProfileBaseAndData(std::optional<std::size_t> index, ProfileBase& profile,
266 UserData& data) const { 291 UserData& data) const {
diff --git a/src/core/hle/service/acc/profile_manager.h b/src/core/hle/service/acc/profile_manager.h
index 135f7d0d5..993a5a57a 100644
--- a/src/core/hle/service/acc/profile_manager.h
+++ b/src/core/hle/service/acc/profile_manager.h
@@ -86,6 +86,8 @@ public:
86 UserIDArray GetOpenUsers() const; 86 UserIDArray GetOpenUsers() const;
87 UserIDArray GetAllUsers() const; 87 UserIDArray GetAllUsers() const;
88 Common::UUID GetLastOpenedUser() const; 88 Common::UUID GetLastOpenedUser() const;
89 UserIDArray GetStoredOpenedUsers() const;
90 void StoreOpenedUsers();
89 91
90 bool CanSystemRegisterUser() const; 92 bool CanSystemRegisterUser() const;
91 93
@@ -101,6 +103,7 @@ private:
101 bool RemoveProfileAtIndex(std::size_t index); 103 bool RemoveProfileAtIndex(std::size_t index);
102 104
103 std::array<ProfileInfo, MAX_USERS> profiles{}; 105 std::array<ProfileInfo, MAX_USERS> profiles{};
106 std::array<ProfileInfo, MAX_USERS> stored_opened_profiles{};
104 std::size_t user_count{}; 107 std::size_t user_count{};
105 Common::UUID last_opened_user{}; 108 Common::UUID last_opened_user{};
106}; 109};
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp
index e2b8d8720..cb6c0e96f 100644
--- a/src/core/hle/service/sm/sm.cpp
+++ b/src/core/hle/service/sm/sm.cpp
@@ -149,9 +149,10 @@ ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(Kernel::HLERequestContext&
149 return port_result.Code(); 149 return port_result.Code();
150 } 150 }
151 auto& port = port_result.Unwrap(); 151 auto& port = port_result.Unwrap();
152 SCOPE_EXIT({ port->GetClientPort().Close(); }); 152 SCOPE_EXIT({
153 153 port->GetClientPort().Close();
154 kernel.RegisterServerObject(&port->GetServerPort()); 154 port->GetServerPort().Close();
155 });
155 156
156 // Create a new session. 157 // Create a new session.
157 Kernel::KClientSession* session{}; 158 Kernel::KClientSession* session{};
diff --git a/src/core/hle/service/sm/sm_controller.cpp b/src/core/hle/service/sm/sm_controller.cpp
index 273f79568..46a8439d8 100644
--- a/src/core/hle/service/sm/sm_controller.cpp
+++ b/src/core/hle/service/sm/sm_controller.cpp
@@ -28,23 +28,36 @@ void Controller::ConvertCurrentObjectToDomain(Kernel::HLERequestContext& ctx) {
28void Controller::CloneCurrentObject(Kernel::HLERequestContext& ctx) { 28void Controller::CloneCurrentObject(Kernel::HLERequestContext& ctx) {
29 LOG_DEBUG(Service, "called"); 29 LOG_DEBUG(Service, "called");
30 30
31 auto& process = *ctx.GetThread().GetOwnerProcess();
31 auto& parent_session = *ctx.Session()->GetParent(); 32 auto& parent_session = *ctx.Session()->GetParent();
32 auto& parent_port = parent_session.GetParent()->GetParent()->GetClientPort();
33 auto& session_manager = parent_session.GetServerSession().GetSessionRequestManager(); 33 auto& session_manager = parent_session.GetServerSession().GetSessionRequestManager();
34 auto& session_handler = session_manager->SessionHandler();
34 35
35 // Create a session. 36 // FIXME: this is duplicated from the SVC, it should just call it instead
36 Kernel::KClientSession* session{}; 37 // once this is a proper process
37 const Result result = parent_port.CreateSession(std::addressof(session), session_manager); 38
38 if (result.IsError()) { 39 // Reserve a new session from the process resource limit.
39 LOG_CRITICAL(Service, "CreateSession failed with error 0x{:08X}", result.raw); 40 Kernel::KScopedResourceReservation session_reservation(&process,
40 IPC::ResponseBuilder rb{ctx, 2}; 41 Kernel::LimitableResource::Sessions);
41 rb.Push(result); 42 ASSERT(session_reservation.Succeeded());
42 } 43
44 // Create the session.
45 Kernel::KSession* session = Kernel::KSession::Create(system.Kernel());
46 ASSERT(session != nullptr);
47
48 // Initialize the session.
49 session->Initialize(nullptr, parent_session.GetName(), session_manager);
50
51 // Commit the session reservation.
52 session_reservation.Commit();
53
54 // Register the session.
55 session_handler.ClientConnected(&session->GetServerSession());
43 56
44 // We succeeded. 57 // We succeeded.
45 IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; 58 IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles};
46 rb.Push(ResultSuccess); 59 rb.Push(ResultSuccess);
47 rb.PushMoveObjects(session); 60 rb.PushMoveObjects(session->GetClientSession());
48} 61}
49 62
50void Controller::CloneCurrentObjectEx(Kernel::HLERequestContext& ctx) { 63void Controller::CloneCurrentObjectEx(Kernel::HLERequestContext& ctx) {
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index 6ab68892c..d94dbf873 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -156,12 +156,10 @@ RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra
156 staging_pool(device, memory_allocator, scheduler), descriptor_pool(device, scheduler), 156 staging_pool(device, memory_allocator, scheduler), descriptor_pool(device, scheduler),
157 update_descriptor_queue(device, scheduler), 157 update_descriptor_queue(device, scheduler),
158 blit_image(device, scheduler, state_tracker, descriptor_pool), 158 blit_image(device, scheduler, state_tracker, descriptor_pool),
159 astc_decoder_pass(device, scheduler, descriptor_pool, staging_pool, update_descriptor_queue,
160 memory_allocator),
161 render_pass_cache(device), texture_cache_runtime{device, scheduler, 159 render_pass_cache(device), texture_cache_runtime{device, scheduler,
162 memory_allocator, staging_pool, 160 memory_allocator, staging_pool,
163 blit_image, astc_decoder_pass, 161 blit_image, render_pass_cache,
164 render_pass_cache}, 162 descriptor_pool, update_descriptor_queue},
165 texture_cache(texture_cache_runtime, *this), 163 texture_cache(texture_cache_runtime, *this),
166 buffer_cache_runtime(device, memory_allocator, scheduler, staging_pool, 164 buffer_cache_runtime(device, memory_allocator, scheduler, staging_pool,
167 update_descriptor_queue, descriptor_pool), 165 update_descriptor_queue, descriptor_pool),
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h
index e2fdc7611..b0bc306f5 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.h
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.h
@@ -155,7 +155,6 @@ private:
155 DescriptorPool descriptor_pool; 155 DescriptorPool descriptor_pool;
156 UpdateDescriptorQueue update_descriptor_queue; 156 UpdateDescriptorQueue update_descriptor_queue;
157 BlitImageHelper blit_image; 157 BlitImageHelper blit_image;
158 ASTCDecoderPass astc_decoder_pass;
159 RenderPassCache render_pass_cache; 158 RenderPassCache render_pass_cache;
160 159
161 TextureCacheRuntime texture_cache_runtime; 160 TextureCacheRuntime texture_cache_runtime;
diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h
index c04aad08f..929216749 100644
--- a/src/video_core/renderer_vulkan/vk_scheduler.h
+++ b/src/video_core/renderer_vulkan/vk_scheduler.h
@@ -144,7 +144,6 @@ private:
144 using FuncType = TypedCommand<T>; 144 using FuncType = TypedCommand<T>;
145 static_assert(sizeof(FuncType) < sizeof(data), "Lambda is too large"); 145 static_assert(sizeof(FuncType) < sizeof(data), "Lambda is too large");
146 146
147 recorded_counts++;
148 command_offset = Common::AlignUp(command_offset, alignof(FuncType)); 147 command_offset = Common::AlignUp(command_offset, alignof(FuncType));
149 if (command_offset > sizeof(data) - sizeof(FuncType)) { 148 if (command_offset > sizeof(data) - sizeof(FuncType)) {
150 return false; 149 return false;
@@ -166,7 +165,7 @@ private:
166 } 165 }
167 166
168 bool Empty() const { 167 bool Empty() const {
169 return recorded_counts == 0; 168 return command_offset == 0;
170 } 169 }
171 170
172 bool HasSubmit() const { 171 bool HasSubmit() const {
@@ -177,7 +176,6 @@ private:
177 Command* first = nullptr; 176 Command* first = nullptr;
178 Command* last = nullptr; 177 Command* last = nullptr;
179 178
180 size_t recorded_counts = 0;
181 size_t command_offset = 0; 179 size_t command_offset = 0;
182 bool submit = false; 180 bool submit = false;
183 alignas(std::max_align_t) std::array<u8, 0x8000> data{}; 181 alignas(std::max_align_t) std::array<u8, 0x8000> data{};
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index 305ad8aee..853b80d8a 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -791,12 +791,17 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched
791 MemoryAllocator& memory_allocator_, 791 MemoryAllocator& memory_allocator_,
792 StagingBufferPool& staging_buffer_pool_, 792 StagingBufferPool& staging_buffer_pool_,
793 BlitImageHelper& blit_image_helper_, 793 BlitImageHelper& blit_image_helper_,
794 ASTCDecoderPass& astc_decoder_pass_, 794 RenderPassCache& render_pass_cache_,
795 RenderPassCache& render_pass_cache_) 795 DescriptorPool& descriptor_pool,
796 UpdateDescriptorQueue& update_descriptor_queue)
796 : device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_}, 797 : device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_},
797 staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_}, 798 staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_},
798 astc_decoder_pass{astc_decoder_pass_}, render_pass_cache{render_pass_cache_}, 799 render_pass_cache{render_pass_cache_}, resolution{Settings::values.resolution_info} {
799 resolution{Settings::values.resolution_info} {} 800 if (Settings::values.accelerate_astc) {
801 astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool,
802 update_descriptor_queue, memory_allocator);
803 }
804}
800 805
801void TextureCacheRuntime::Finish() { 806void TextureCacheRuntime::Finish() {
802 scheduler.Finish(); 807 scheduler.Finish();
@@ -1782,17 +1787,17 @@ void Framebuffer::CreateFramebuffer(TextureCacheRuntime& runtime,
1782 1787
1783 const auto& resolution = runtime.resolution; 1788 const auto& resolution = runtime.resolution;
1784 1789
1785 u32 width = 0; 1790 u32 width = std::numeric_limits<u32>::max();
1786 u32 height = 0; 1791 u32 height = std::numeric_limits<u32>::max();
1787 for (size_t index = 0; index < NUM_RT; ++index) { 1792 for (size_t index = 0; index < NUM_RT; ++index) {
1788 const ImageView* const color_buffer = color_buffers[index]; 1793 const ImageView* const color_buffer = color_buffers[index];
1789 if (!color_buffer) { 1794 if (!color_buffer) {
1790 renderpass_key.color_formats[index] = PixelFormat::Invalid; 1795 renderpass_key.color_formats[index] = PixelFormat::Invalid;
1791 continue; 1796 continue;
1792 } 1797 }
1793 width = std::max(width, is_rescaled ? resolution.ScaleUp(color_buffer->size.width) 1798 width = std::min(width, is_rescaled ? resolution.ScaleUp(color_buffer->size.width)
1794 : color_buffer->size.width); 1799 : color_buffer->size.width);
1795 height = std::max(height, is_rescaled ? resolution.ScaleUp(color_buffer->size.height) 1800 height = std::min(height, is_rescaled ? resolution.ScaleUp(color_buffer->size.height)
1796 : color_buffer->size.height); 1801 : color_buffer->size.height);
1797 attachments.push_back(color_buffer->RenderTarget()); 1802 attachments.push_back(color_buffer->RenderTarget());
1798 renderpass_key.color_formats[index] = color_buffer->format; 1803 renderpass_key.color_formats[index] = color_buffer->format;
@@ -1804,9 +1809,9 @@ void Framebuffer::CreateFramebuffer(TextureCacheRuntime& runtime,
1804 } 1809 }
1805 const size_t num_colors = attachments.size(); 1810 const size_t num_colors = attachments.size();
1806 if (depth_buffer) { 1811 if (depth_buffer) {
1807 width = std::max(width, is_rescaled ? resolution.ScaleUp(depth_buffer->size.width) 1812 width = std::min(width, is_rescaled ? resolution.ScaleUp(depth_buffer->size.width)
1808 : depth_buffer->size.width); 1813 : depth_buffer->size.width);
1809 height = std::max(height, is_rescaled ? resolution.ScaleUp(depth_buffer->size.height) 1814 height = std::min(height, is_rescaled ? resolution.ScaleUp(depth_buffer->size.height)
1810 : depth_buffer->size.height); 1815 : depth_buffer->size.height);
1811 attachments.push_back(depth_buffer->RenderTarget()); 1816 attachments.push_back(depth_buffer->RenderTarget());
1812 renderpass_key.depth_format = depth_buffer->format; 1817 renderpass_key.depth_format = depth_buffer->format;
@@ -1845,7 +1850,7 @@ void TextureCacheRuntime::AccelerateImageUpload(
1845 Image& image, const StagingBufferRef& map, 1850 Image& image, const StagingBufferRef& map,
1846 std::span<const VideoCommon::SwizzleParameters> swizzles) { 1851 std::span<const VideoCommon::SwizzleParameters> swizzles) {
1847 if (IsPixelFormatASTC(image.info.format)) { 1852 if (IsPixelFormatASTC(image.info.format)) {
1848 return astc_decoder_pass.Assemble(image, map, swizzles); 1853 return astc_decoder_pass->Assemble(image, map, swizzles);
1849 } 1854 }
1850 ASSERT(false); 1855 ASSERT(false);
1851} 1856}
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h
index 0b7ac0df1..7ec0df134 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.h
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.h
@@ -6,6 +6,7 @@
6#include <span> 6#include <span>
7 7
8#include "shader_recompiler/shader_info.h" 8#include "shader_recompiler/shader_info.h"
9#include "video_core/renderer_vulkan/vk_compute_pass.h"
9#include "video_core/renderer_vulkan/vk_staging_buffer_pool.h" 10#include "video_core/renderer_vulkan/vk_staging_buffer_pool.h"
10#include "video_core/texture_cache/image_view_base.h" 11#include "video_core/texture_cache/image_view_base.h"
11#include "video_core/texture_cache/texture_cache_base.h" 12#include "video_core/texture_cache/texture_cache_base.h"
@@ -25,14 +26,15 @@ using VideoCommon::RenderTargets;
25using VideoCommon::SlotVector; 26using VideoCommon::SlotVector;
26using VideoCore::Surface::PixelFormat; 27using VideoCore::Surface::PixelFormat;
27 28
28class ASTCDecoderPass;
29class BlitImageHelper; 29class BlitImageHelper;
30class DescriptorPool;
30class Device; 31class Device;
31class Image; 32class Image;
32class ImageView; 33class ImageView;
33class Framebuffer; 34class Framebuffer;
34class RenderPassCache; 35class RenderPassCache;
35class StagingBufferPool; 36class StagingBufferPool;
37class UpdateDescriptorQueue;
36class Scheduler; 38class Scheduler;
37 39
38class TextureCacheRuntime { 40class TextureCacheRuntime {
@@ -41,8 +43,9 @@ public:
41 MemoryAllocator& memory_allocator_, 43 MemoryAllocator& memory_allocator_,
42 StagingBufferPool& staging_buffer_pool_, 44 StagingBufferPool& staging_buffer_pool_,
43 BlitImageHelper& blit_image_helper_, 45 BlitImageHelper& blit_image_helper_,
44 ASTCDecoderPass& astc_decoder_pass_, 46 RenderPassCache& render_pass_cache_,
45 RenderPassCache& render_pass_cache_); 47 DescriptorPool& descriptor_pool,
48 UpdateDescriptorQueue& update_descriptor_queue);
46 49
47 void Finish(); 50 void Finish();
48 51
@@ -97,8 +100,8 @@ public:
97 MemoryAllocator& memory_allocator; 100 MemoryAllocator& memory_allocator;
98 StagingBufferPool& staging_buffer_pool; 101 StagingBufferPool& staging_buffer_pool;
99 BlitImageHelper& blit_image_helper; 102 BlitImageHelper& blit_image_helper;
100 ASTCDecoderPass& astc_decoder_pass;
101 RenderPassCache& render_pass_cache; 103 RenderPassCache& render_pass_cache;
104 std::optional<ASTCDecoderPass> astc_decoder_pass;
102 const Settings::ResolutionScalingInfo& resolution; 105 const Settings::ResolutionScalingInfo& resolution;
103 106
104 constexpr static size_t indexing_slots = 8 * sizeof(size_t); 107 constexpr static size_t indexing_slots = 8 * sizeof(size_t);
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui
index 74d49dbd4..e670acc30 100644
--- a/src/yuzu/main.ui
+++ b/src/yuzu/main.ui
@@ -55,7 +55,6 @@
55 <addaction name="separator"/> 55 <addaction name="separator"/>
56 <addaction name="menu_recent_files"/> 56 <addaction name="menu_recent_files"/>
57 <addaction name="separator"/> 57 <addaction name="separator"/>
58 <addaction name="separator"/>
59 <addaction name="action_Load_Amiibo"/> 58 <addaction name="action_Load_Amiibo"/>
60 <addaction name="separator"/> 59 <addaction name="separator"/>
61 <addaction name="action_Open_yuzu_Folder"/> 60 <addaction name="action_Open_yuzu_Folder"/>