diff options
-rwxr-xr-x | README.md | 2 | ||||
-rwxr-xr-x | src/core/hle/service/ns/application_manager_interface.cpp | 6 | ||||
-rwxr-xr-x | src/core/hle/service/ns/application_manager_interface.h | 2 | ||||
-rwxr-xr-x | src/core/hle/service/ns/ns_types.h | 5 | ||||
-rwxr-xr-x | src/core/hle/service/ns/query_service.cpp | 5 | ||||
-rwxr-xr-x | src/core/hle/service/ns/query_service.h | 4 | ||||
-rwxr-xr-x | src/video_core/texture_cache/texture_cache.h | 30 |
7 files changed, 37 insertions, 17 deletions
@@ -1,7 +1,7 @@ | |||
1 | yuzu emulator early access | 1 | yuzu emulator early access |
2 | ============= | 2 | ============= |
3 | 3 | ||
4 | This is the source code for early-access 4155. | 4 | This is the source code for early-access 4156. |
5 | 5 | ||
6 | ## Legal Notice | 6 | ## Legal Notice |
7 | 7 | ||
diff --git a/src/core/hle/service/ns/application_manager_interface.cpp b/src/core/hle/service/ns/application_manager_interface.cpp index 2e3a44c0d..7a91727f9 100755 --- a/src/core/hle/service/ns/application_manager_interface.cpp +++ b/src/core/hle/service/ns/application_manager_interface.cpp | |||
@@ -436,14 +436,14 @@ Result IApplicationManagerInterface::GetApplicationViewWithPromotionInfo( | |||
436 | 436 | ||
437 | Result IApplicationManagerInterface::GetApplicationRightsOnClient( | 437 | Result IApplicationManagerInterface::GetApplicationRightsOnClient( |
438 | OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count, | 438 | OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count, |
439 | Common::UUID account_id, u32 flags, u64 application_id) { | 439 | u32 flags, u64 application_id, Uid account_id) { |
440 | LOG_WARNING(Service_NS, "(STUBBED) called, flags={}, application_id={:016X}, account_id={}", | 440 | LOG_WARNING(Service_NS, "(STUBBED) called, flags={}, application_id={:016X}, account_id={}", |
441 | flags, application_id, account_id.FormattedString()); | 441 | flags, application_id, account_id.uuid.FormattedString()); |
442 | 442 | ||
443 | if (!out_rights.empty()) { | 443 | if (!out_rights.empty()) { |
444 | ApplicationRightsOnClient rights{}; | 444 | ApplicationRightsOnClient rights{}; |
445 | rights.application_id = application_id; | 445 | rights.application_id = application_id; |
446 | rights.uid = account_id; | 446 | rights.uid = account_id.uuid; |
447 | rights.flags = 0; | 447 | rights.flags = 0; |
448 | rights.flags2 = 0; | 448 | rights.flags2 = 0; |
449 | 449 | ||
diff --git a/src/core/hle/service/ns/application_manager_interface.h b/src/core/hle/service/ns/application_manager_interface.h index 350ec37ce..f33d269b3 100755 --- a/src/core/hle/service/ns/application_manager_interface.h +++ b/src/core/hle/service/ns/application_manager_interface.h | |||
@@ -37,7 +37,7 @@ public: | |||
37 | InArray<u64, BufferAttr_HipcMapAlias> application_ids); | 37 | InArray<u64, BufferAttr_HipcMapAlias> application_ids); |
38 | Result GetApplicationRightsOnClient( | 38 | Result GetApplicationRightsOnClient( |
39 | OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count, | 39 | OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count, |
40 | Common::UUID account_id, u32 flags, u64 application_id); | 40 | u32 flags, u64 application_id, Uid account_id); |
41 | Result CheckSdCardMountStatus(); | 41 | Result CheckSdCardMountStatus(); |
42 | Result GetSdCardMountStatusChangedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event); | 42 | Result GetSdCardMountStatusChangedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event); |
43 | Result GetFreeSpaceSize(Out<s64> out_free_space_size, FileSys::StorageId storage_id); | 43 | Result GetFreeSpaceSize(Out<s64> out_free_space_size, FileSys::StorageId storage_id); |
diff --git a/src/core/hle/service/ns/ns_types.h b/src/core/hle/service/ns/ns_types.h index 38421b0f4..2dd664c4e 100755 --- a/src/core/hle/service/ns/ns_types.h +++ b/src/core/hle/service/ns/ns_types.h | |||
@@ -108,4 +108,9 @@ struct ContentPath { | |||
108 | }; | 108 | }; |
109 | static_assert(sizeof(ContentPath) == 0x10, "ContentPath has incorrect size."); | 109 | static_assert(sizeof(ContentPath) == 0x10, "ContentPath has incorrect size."); |
110 | 110 | ||
111 | struct Uid { | ||
112 | alignas(8) Common::UUID uuid; | ||
113 | }; | ||
114 | static_assert(sizeof(Uid) == 0x10, "Uid has incorrect size."); | ||
115 | |||
111 | } // namespace Service::NS | 116 | } // namespace Service::NS |
diff --git a/src/core/hle/service/ns/query_service.cpp b/src/core/hle/service/ns/query_service.cpp index 946b7fa23..138400541 100755 --- a/src/core/hle/service/ns/query_service.cpp +++ b/src/core/hle/service/ns/query_service.cpp | |||
@@ -41,8 +41,7 @@ IQueryService::IQueryService(Core::System& system_) : ServiceFramework{system_, | |||
41 | IQueryService::~IQueryService() = default; | 41 | IQueryService::~IQueryService() = default; |
42 | 42 | ||
43 | Result IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId( | 43 | Result IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId( |
44 | Out<PlayStatistics> out_play_statistics, bool unknown, Common::UUID account_id, | 44 | Out<PlayStatistics> out_play_statistics, bool unknown, u64 application_id, Uid account_id) { |
45 | u64 application_id) { | ||
46 | // TODO(German77): Read statistics of the game | 45 | // TODO(German77): Read statistics of the game |
47 | *out_play_statistics = { | 46 | *out_play_statistics = { |
48 | .application_id = application_id, | 47 | .application_id = application_id, |
@@ -50,7 +49,7 @@ Result IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId( | |||
50 | }; | 49 | }; |
51 | 50 | ||
52 | LOG_WARNING(Service_NS, "(STUBBED) called. unknown={}. application_id={:016X}, account_id={}", | 51 | LOG_WARNING(Service_NS, "(STUBBED) called. unknown={}. application_id={:016X}, account_id={}", |
53 | unknown, application_id, account_id.FormattedString()); | 52 | unknown, application_id, account_id.uuid.FormattedString()); |
54 | R_SUCCEED(); | 53 | R_SUCCEED(); |
55 | } | 54 | } |
56 | 55 | ||
diff --git a/src/core/hle/service/ns/query_service.h b/src/core/hle/service/ns/query_service.h index 6cdbfa277..c4c82b752 100755 --- a/src/core/hle/service/ns/query_service.h +++ b/src/core/hle/service/ns/query_service.h | |||
@@ -5,6 +5,7 @@ | |||
5 | 5 | ||
6 | #include "common/uuid.h" | 6 | #include "common/uuid.h" |
7 | #include "core/hle/service/cmif_types.h" | 7 | #include "core/hle/service/cmif_types.h" |
8 | #include "core/hle/service/ns/ns_types.h" | ||
8 | #include "core/hle/service/service.h" | 9 | #include "core/hle/service/service.h" |
9 | 10 | ||
10 | namespace Service::NS { | 11 | namespace Service::NS { |
@@ -29,8 +30,7 @@ public: | |||
29 | 30 | ||
30 | private: | 31 | private: |
31 | Result QueryPlayStatisticsByApplicationIdAndUserAccountId( | 32 | Result QueryPlayStatisticsByApplicationIdAndUserAccountId( |
32 | Out<PlayStatistics> out_play_statistics, bool unknown, Common::UUID account_id, | 33 | Out<PlayStatistics> out_play_statistics, bool unknown, u64 application_id, Uid account_id); |
33 | u64 application_id); | ||
34 | }; | 34 | }; |
35 | 35 | ||
36 | } // namespace Service::NS | 36 | } // namespace Service::NS |
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index f790897ef..13f056214 100755 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
@@ -72,12 +72,19 @@ TextureCache<P>::TextureCache(Runtime& runtime_, Tegra::MaxwellDeviceMemoryManag | |||
72 | 72 | ||
73 | template <class P> | 73 | template <class P> |
74 | void TextureCache<P>::RunGarbageCollector() { | 74 | void TextureCache<P>::RunGarbageCollector() { |
75 | bool high_priority_mode = total_used_memory >= expected_memory; | 75 | bool high_priority_mode = false; |
76 | bool aggressive_mode = total_used_memory >= critical_memory; | 76 | bool aggressive_mode = false; |
77 | const u64 ticks_to_destroy = aggressive_mode ? 10ULL : high_priority_mode ? 25ULL : 50ULL; | 77 | u64 ticks_to_destroy = 0; |
78 | size_t num_iterations = aggressive_mode ? 40 : (high_priority_mode ? 20 : 10); | 78 | size_t num_iterations = 0; |
79 | const auto clean_up = [this, &num_iterations, &high_priority_mode, | 79 | |
80 | &aggressive_mode](ImageId image_id) { | 80 | const auto Configure = [&](bool allow_aggressive) { |
81 | high_priority_mode = total_used_memory >= expected_memory; | ||
82 | aggressive_mode = allow_aggressive && total_used_memory >= critical_memory; | ||
83 | ticks_to_destroy = aggressive_mode ? 10ULL : high_priority_mode ? 25ULL : 50ULL; | ||
84 | num_iterations = aggressive_mode ? 40 : (high_priority_mode ? 20 : 10); | ||
85 | }; | ||
86 | const auto Cleanup = [this, &num_iterations, &high_priority_mode, | ||
87 | &aggressive_mode](ImageId image_id) { | ||
81 | if (num_iterations == 0) { | 88 | if (num_iterations == 0) { |
82 | return true; | 89 | return true; |
83 | } | 90 | } |
@@ -123,7 +130,16 @@ void TextureCache<P>::RunGarbageCollector() { | |||
123 | } | 130 | } |
124 | return false; | 131 | return false; |
125 | }; | 132 | }; |
126 | lru_cache.ForEachItemBelow(frame_tick - ticks_to_destroy, clean_up); | 133 | |
134 | // Try to remove anything old enough and not high priority. | ||
135 | Configure(false); | ||
136 | lru_cache.ForEachItemBelow(frame_tick - ticks_to_destroy, Cleanup); | ||
137 | |||
138 | // If pressure is still too high, prune aggressively. | ||
139 | if (total_used_memory >= critical_memory) { | ||
140 | Configure(true); | ||
141 | lru_cache.ForEachItemBelow(frame_tick - ticks_to_destroy, Cleanup); | ||
142 | } | ||
127 | } | 143 | } |
128 | 144 | ||
129 | template <class P> | 145 | template <class P> |