Compare commits

..

1 Commits

Author SHA1 Message Date
xbzk 5c09959f11 [wip] 30 sep nightly perf test build 2026-09-30 23:44:31 -03:00
3 changed files with 42 additions and 42 deletions
+20 -18
View File
@@ -426,28 +426,30 @@ public:
std::addressof(ro_size), std::addressof(rw_size), std::addressof(ro_size), std::addressof(rw_size),
nro_info->base_address, nro_size, bss_size)); nro_info->base_address, nro_size, bss_size));
#ifdef HAS_NCE #ifdef HAS_NCE
if (Settings::IsNceEnabled()) { if (Settings::GetDebugKnobAt(1)) {
auto* process = context->GetProcess(); if (Settings::IsNceEnabled()) {
auto& memory = process->GetMemory(); auto* process = context->GetProcess();
auto& memory = process->GetMemory();
std::vector<u8> image(total_size); std::vector<u8> image(total_size);
memory.ReadBlock(nro_info->base_address, image.data(), rx_size); memory.ReadBlock(nro_info->base_address, image.data(), rx_size);
Kernel::CodeSet::Segment code{.size = static_cast<u32>(rx_size)}; Kernel::CodeSet::Segment code{.size = static_cast<u32>(rx_size)};
Core::NCE::Patcher patch; Core::NCE::Patcher patch;
patch.PatchText(image, code); patch.PatchText(image, code);
patch.RelocateAndCopy(nro_info->base_address, code, image, nullptr); patch.RelocateAndCopy(nro_info->base_address, code, image, nullptr);
const u64 patch_address = nro_info->base_address + total_size; const u64 patch_address = nro_info->base_address + total_size;
const size_t patch_size = patch.GetSectionSize(); const size_t patch_size = patch.GetSectionSize();
constexpr auto permission = Kernel::Svc::MemoryPermission::ReadExecute; constexpr auto permission = Kernel::Svc::MemoryPermission::ReadExecute;
auto* patch_memory = Kernel::KSharedMemory::Create(kernel); auto* patch_memory = Kernel::KSharedMemory::Create(kernel);
R_TRY(patch_memory->Initialize(kernel, kernel.System().DeviceMemory(), process, permission, permission, patch_size)); R_TRY(patch_memory->Initialize(kernel, kernel.System().DeviceMemory(), process, permission, permission, patch_size));
std::memcpy(patch_memory->GetPointer(), image.data() + total_size, patch_size); std::memcpy(patch_memory->GetPointer(), image.data() + total_size, patch_size);
R_TRY(process->AddSharedMemory(kernel, patch_memory, patch_address, patch_size)); R_TRY(process->AddSharedMemory(kernel, patch_memory, patch_address, patch_size));
R_TRY(patch_memory->Map(*process, patch_address, patch_size, permission)); R_TRY(patch_memory->Map(*process, patch_address, patch_size, permission));
memory.WriteBlock(nro_info->base_address, image.data(), rx_size); memory.WriteBlock(nro_info->base_address, image.data(), rx_size);
}
} }
#endif #endif
// Set NRO perms. // Set NRO perms.
+11 -9
View File
@@ -227,15 +227,17 @@ struct GPU::Impl {
/// Notify rasterizer that any caches of the specified region should be invalidated /// Notify rasterizer that any caches of the specified region should be invalidated
void InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) { void InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) {
VideoCore::RasterizerInterface* rasterizer = renderer->ReadRasterizer(); if (Settings::GetDebugKnobAt(0)) {
if (preserve_gpu_writes && rasterizer->MustFlushRegion(addr, size, VideoCommon::CacheType::BufferCache)) { VideoCore::RasterizerInterface* rasterizer = renderer->ReadRasterizer();
const u64 fence = RequestSyncOperation([rasterizer, addr, size] { if (preserve_gpu_writes && rasterizer->MustFlushRegion(addr, size, VideoCommon::CacheType::BufferCache)) {
rasterizer->FlushRegion(addr, size, VideoCommon::CacheType::BufferCache); const u64 fence = RequestSyncOperation([rasterizer, addr, size] {
rasterizer->OnCacheInvalidation(addr, size); rasterizer->FlushRegion(addr, size, VideoCommon::CacheType::BufferCache);
}); rasterizer->OnCacheInvalidation(addr, size);
gpu_thread.TickGPU(is_async); });
WaitForSyncOperation(fence); gpu_thread.TickGPU(is_async);
return; WaitForSyncOperation(fence);
return;
}
} }
gpu_thread.InvalidateRegion(addr, size); gpu_thread.InvalidateRegion(addr, size);
} }
+11 -15
View File
@@ -12,29 +12,25 @@ namespace Yuzu {
inline bool ContainsAllWords(const QString& haystack, const QString& userinput) { inline bool ContainsAllWords(const QString& haystack, const QString& userinput) {
const QStringList userinput_split = userinput.split(QLatin1Char{' '}, Qt::SkipEmptyParts); const QStringList userinput_split = userinput.split(QLatin1Char{' '}, Qt::SkipEmptyParts);
return std::all_of(userinput_split.begin(), userinput_split.end(), [&haystack](const QString& s) { return std::all_of(userinput_split.begin(), userinput_split.end(),
return haystack.contains(s); [&haystack](const QString& s) { return haystack.contains(s); });
});
} }
inline bool FilterMatches(const QString& filter, const QStandardItem* item) { inline bool FilterMatches(const QString& filter, const QStandardItem* item) {
if (filter.isEmpty()) if (filter.isEmpty())
return true; return true;
auto const sluggify = [](const QString& s) {
QString o(s.normalized(QString::NormalizationForm_D).toLower());
return o.replace(QRegularExpression(QStringLiteral("[^a-z\\s]")), QStringLiteral(""));
};
const auto norm_filter = sluggify(filter);
const auto program_id = item->data(GameListItemPath::ProgramIdRole).toULongLong(); const auto program_id = item->data(GameListItemPath::ProgramIdRole).toULongLong();
const QString file_path = sluggify(item->data(GameListItemPath::FullPathRole).toString());
const QString file_title = sluggify(item->data(GameListItemPath::TitleRole).toString()); const QString file_path = item->data(GameListItemPath::FullPathRole).toString().toLower();
const QString file_title = item->data(GameListItemPath::TitleRole).toString().toLower();
const QString file_program_id = QStringLiteral("%1").arg(program_id, 16, 16, QLatin1Char{'0'}); const QString file_program_id = QStringLiteral("%1").arg(program_id, 16, 16, QLatin1Char{'0'});
const QString file_name = sluggify(file_path.mid(file_path.lastIndexOf(QLatin1Char{'/'}) + 1) + QLatin1Char{' '} + file_title);
return (ContainsAllWords(file_name, norm_filter) const QString file_name =
|| ContainsAllWords(file_title, norm_filter)) file_path.mid(file_path.lastIndexOf(QLatin1Char{'/'}) + 1) + QLatin1Char{' '} + file_title;
|| (file_program_id.size() == 16 && file_program_id.contains(norm_filter));
return Yuzu::ContainsAllWords(file_name, filter) ||
(file_program_id.size() == 16 && file_program_id.contains(filter));
} }
} // namespace Yuzu } // namespace Yuzu