early-access version 4156

This commit is contained in:
pineappleEA 2024-02-21 05:33:37 +01:00
parent b86c4f1e66
commit 4565d8fcd8
7 changed files with 37 additions and 17 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 4155. This is the source code for early-access 4156.
## Legal Notice ## Legal Notice

View file

@ -436,14 +436,14 @@ Result IApplicationManagerInterface::GetApplicationViewWithPromotionInfo(
Result IApplicationManagerInterface::GetApplicationRightsOnClient( Result IApplicationManagerInterface::GetApplicationRightsOnClient(
OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count, OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count,
Common::UUID account_id, u32 flags, u64 application_id) { u32 flags, u64 application_id, Uid account_id) {
LOG_WARNING(Service_NS, "(STUBBED) called, flags={}, application_id={:016X}, account_id={}", LOG_WARNING(Service_NS, "(STUBBED) called, flags={}, application_id={:016X}, account_id={}",
flags, application_id, account_id.FormattedString()); flags, application_id, account_id.uuid.FormattedString());
if (!out_rights.empty()) { if (!out_rights.empty()) {
ApplicationRightsOnClient rights{}; ApplicationRightsOnClient rights{};
rights.application_id = application_id; rights.application_id = application_id;
rights.uid = account_id; rights.uid = account_id.uuid;
rights.flags = 0; rights.flags = 0;
rights.flags2 = 0; rights.flags2 = 0;

View file

@ -37,7 +37,7 @@ public:
InArray<u64, BufferAttr_HipcMapAlias> application_ids); InArray<u64, BufferAttr_HipcMapAlias> application_ids);
Result GetApplicationRightsOnClient( Result GetApplicationRightsOnClient(
OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count, OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count,
Common::UUID account_id, u32 flags, u64 application_id); u32 flags, u64 application_id, Uid account_id);
Result CheckSdCardMountStatus(); Result CheckSdCardMountStatus();
Result GetSdCardMountStatusChangedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event); Result GetSdCardMountStatusChangedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
Result GetFreeSpaceSize(Out<s64> out_free_space_size, FileSys::StorageId storage_id); Result GetFreeSpaceSize(Out<s64> out_free_space_size, FileSys::StorageId storage_id);

View file

@ -108,4 +108,9 @@ struct ContentPath {
}; };
static_assert(sizeof(ContentPath) == 0x10, "ContentPath has incorrect size."); static_assert(sizeof(ContentPath) == 0x10, "ContentPath has incorrect size.");
struct Uid {
alignas(8) Common::UUID uuid;
};
static_assert(sizeof(Uid) == 0x10, "Uid has incorrect size.");
} // namespace Service::NS } // namespace Service::NS

View file

@ -41,8 +41,7 @@ IQueryService::IQueryService(Core::System& system_) : ServiceFramework{system_,
IQueryService::~IQueryService() = default; IQueryService::~IQueryService() = default;
Result IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId( Result IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId(
Out<PlayStatistics> out_play_statistics, bool unknown, Common::UUID account_id, Out<PlayStatistics> out_play_statistics, bool unknown, u64 application_id, Uid account_id) {
u64 application_id) {
// TODO(German77): Read statistics of the game // TODO(German77): Read statistics of the game
*out_play_statistics = { *out_play_statistics = {
.application_id = application_id, .application_id = application_id,
@ -50,7 +49,7 @@ Result IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId(
}; };
LOG_WARNING(Service_NS, "(STUBBED) called. unknown={}. application_id={:016X}, account_id={}", LOG_WARNING(Service_NS, "(STUBBED) called. unknown={}. application_id={:016X}, account_id={}",
unknown, application_id, account_id.FormattedString()); unknown, application_id, account_id.uuid.FormattedString());
R_SUCCEED(); R_SUCCEED();
} }

View file

@ -5,6 +5,7 @@
#include "common/uuid.h" #include "common/uuid.h"
#include "core/hle/service/cmif_types.h" #include "core/hle/service/cmif_types.h"
#include "core/hle/service/ns/ns_types.h"
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
namespace Service::NS { namespace Service::NS {
@ -29,8 +30,7 @@ public:
private: private:
Result QueryPlayStatisticsByApplicationIdAndUserAccountId( Result QueryPlayStatisticsByApplicationIdAndUserAccountId(
Out<PlayStatistics> out_play_statistics, bool unknown, Common::UUID account_id, Out<PlayStatistics> out_play_statistics, bool unknown, u64 application_id, Uid account_id);
u64 application_id);
}; };
} // namespace Service::NS } // namespace Service::NS

View file

@ -72,11 +72,18 @@ TextureCache<P>::TextureCache(Runtime& runtime_, Tegra::MaxwellDeviceMemoryManag
template <class P> template <class P>
void TextureCache<P>::RunGarbageCollector() { void TextureCache<P>::RunGarbageCollector() {
bool high_priority_mode = total_used_memory >= expected_memory; bool high_priority_mode = false;
bool aggressive_mode = total_used_memory >= critical_memory; bool aggressive_mode = false;
const u64 ticks_to_destroy = aggressive_mode ? 10ULL : high_priority_mode ? 25ULL : 50ULL; u64 ticks_to_destroy = 0;
size_t num_iterations = aggressive_mode ? 40 : (high_priority_mode ? 20 : 10); size_t num_iterations = 0;
const auto clean_up = [this, &num_iterations, &high_priority_mode,
const auto Configure = [&](bool allow_aggressive) {
high_priority_mode = total_used_memory >= expected_memory;
aggressive_mode = allow_aggressive && total_used_memory >= critical_memory;
ticks_to_destroy = aggressive_mode ? 10ULL : high_priority_mode ? 25ULL : 50ULL;
num_iterations = aggressive_mode ? 40 : (high_priority_mode ? 20 : 10);
};
const auto Cleanup = [this, &num_iterations, &high_priority_mode,
&aggressive_mode](ImageId image_id) { &aggressive_mode](ImageId image_id) {
if (num_iterations == 0) { if (num_iterations == 0) {
return true; return true;
@ -123,7 +130,16 @@ void TextureCache<P>::RunGarbageCollector() {
} }
return false; return false;
}; };
lru_cache.ForEachItemBelow(frame_tick - ticks_to_destroy, clean_up);
// Try to remove anything old enough and not high priority.
Configure(false);
lru_cache.ForEachItemBelow(frame_tick - ticks_to_destroy, Cleanup);
// If pressure is still too high, prune aggressively.
if (total_used_memory >= critical_memory) {
Configure(true);
lru_cache.ForEachItemBelow(frame_tick - ticks_to_destroy, Cleanup);
}
} }
template <class P> template <class P>