1
0
mirror of https://github.com/dolphin-emu/dolphin synced 2024-06-28 22:46:42 +00:00

Compare commits

...

7 Commits

19 changed files with 363 additions and 6 deletions

View File

@ -0,0 +1,40 @@
{
"meta":
{
"title": "Performance Fixes",
"author": "iwubcode",
"description": "Automatically disables 'Store EFB Copies to Texture Only' when viewing unknown photo fish in the photobook."
},
"groups":
[
{
"name": "InvisiblePhotoFish",
"targets": [
{
"type": "efb",
"texture_filename": "efb1_n000920_256x256_3"
},
{
"type": "efb",
"texture_filename": "efb1_n000921_128x128_3"
},
{
"type": "efb",
"texture_filename": "efb1_n005662_448x448_3"
}
]
}
],
"features":
[
{
"group": "InvisiblePhotoFish",
"action": "set_settings",
"action_data":
{
"setting_name": "skip_efb_to_ram",
"setting_value": false
}
}
]
}

View File

@ -0,0 +1,32 @@
{
"meta":
{
"title": "Performance Fixes",
"author": "iwubcode",
"description": "Automatically disables 'Store EFB Copies to Texture Only' during scenes when snow falls."
},
"groups":
[
{
"name": "Snow",
"targets": [
{
"type": "efb",
"texture_filename": "efb1_n000387_256x256_3"
}
]
}
],
"features":
[
{
"group": "Snow",
"action": "set_settings",
"action_data":
{
"setting_name": "skip_efb_to_ram",
"setting_value": false
}
}
]
}

View File

@ -0,0 +1,73 @@
{
"meta":
{
"title": "Performance Fixes",
"author": "iwubcode",
"description": "Automatically disables 'Store EFB Copies to Texture Only' when a character is offscreen. Automatically disables 'Store XFB Copies to Texture Only' during the classic mode clear screen."
},
"groups":
[
{
"name": "OffscreenHoop",
"targets": [
{
"type": "efb",
"texture_filename": "efb1_n000022_4x4_6"
}
]
},
{
"name": "GameFinished",
"targets": [
{
"type": "draw_started",
"texture_filename": "tex1_400x148_5449617efae6c800_2"
}
]
},
{
"name": "GameFinishedNextScreen",
"targets": [
{
"comment": "C icon in complete for classic mode",
"type": "draw_started",
"texture_filename": "tex1_64x64_8e4f1690719cedc3_5b746334fe35ceed_9"
},
{
"comment": "winner icon in free for all",
"type": "draw_started",
"texture_filename": "tex1_104x80_62c38626af7e71e5_ebce21f4ae57a46e_9"
}
]
}
],
"features":
[
{
"group": "OffscreenHoop",
"action": "set_settings",
"action_data":
{
"setting_name": "skip_efb_to_ram",
"setting_value": false
}
},
{
"group": "GameFinished",
"action": "set_settings",
"action_data":
{
"setting_name": "skip_xfb_to_ram",
"setting_value": false
}
},
{
"group": "GameFinishedNextScreen",
"action": "set_settings",
"action_data":
{
"setting_name": "skip_xfb_to_ram"
}
}
]
}

View File

@ -0,0 +1,49 @@
{
"meta":
{
"title": "Windwaker Performance Fixes",
"author": "iwubcode",
"description": "Automatically disables 'Store EFB Copies to Texture Only' during pictograph gameplay."
},
"groups":
[
{
"name": "PictographStart",
"targets": [
{
"type": "draw_started",
"texture_filename": "tex1_32x224_ccd5b94c8c1af275_14"
}
]
},
{
"name": "PictographEnd",
"targets": [
{
"type": "draw_started",
"texture_filename": "tex1_24x24_7e201aa9d5e4a597_598b8b532cc3e935_9"
}
]
}
],
"features":
[
{
"group": "PictographStart",
"action": "set_settings",
"action_data":
{
"setting_name": "skip_efb_to_ram",
"setting_value": false
}
},
{
"group": "PictographEnd",
"action": "set_settings",
"action_data":
{
"setting_name": "skip_efb_to_ram"
}
}
]
}

View File

@ -874,7 +874,7 @@ It can efficiently compress both junk data and encrypted Wii data.
<string name="about_website"><a href="https://dolphin-emu.org/">Website</a></string>
<string name="about_github"><a href="https://github.com/dolphin-emu/dolphin">GitHub</a></string>
<string name="about_support"><a href="https://forums.dolphin-emu.org/">Support</a></string>
<string name="about_copyright_warning">\u00A9 20032015+ Dolphin Team. \u201cGameCube\u201d and \u201cWii\u201d are trademarks of Nintendo. Dolphin is not affiliated with Nintendo in any way.</string>
<string name="about_copyright_warning">\u00A9 20032024+ Dolphin Team. \u201cGameCube\u201d and \u201cWii\u201d are trademarks of Nintendo. Dolphin is not affiliated with Nintendo in any way.</string>
<string name="system_driver">System driver</string>
<string name="system_driver_desc">The GPU driver that is part of the OS.</string>

View File

@ -696,6 +696,7 @@
<ClInclude Include="VideoCommon\GraphicsModSystem\Runtime\Actions\MoveAction.h" />
<ClInclude Include="VideoCommon\GraphicsModSystem\Runtime\Actions\PrintAction.h" />
<ClInclude Include="VideoCommon\GraphicsModSystem\Runtime\Actions\ScaleAction.h" />
<ClInclude Include="VideoCommon\GraphicsModSystem\Runtime\Actions\SetSettingsAction.h" />
<ClInclude Include="VideoCommon\GraphicsModSystem\Runtime\Actions\SkipAction.h" />
<ClInclude Include="VideoCommon\GraphicsModSystem\Runtime\CustomPipeline.h" />
<ClInclude Include="VideoCommon\GraphicsModSystem\Runtime\CustomShaderCache.h" />
@ -1336,6 +1337,7 @@
<ClCompile Include="VideoCommon\GraphicsModSystem\Runtime\Actions\MoveAction.cpp" />
<ClCompile Include="VideoCommon\GraphicsModSystem\Runtime\Actions\PrintAction.cpp" />
<ClCompile Include="VideoCommon\GraphicsModSystem\Runtime\Actions\ScaleAction.cpp" />
<ClCompile Include="VideoCommon\GraphicsModSystem\Runtime\Actions\SetSettingsAction.cpp" />
<ClCompile Include="VideoCommon\GraphicsModSystem\Runtime\Actions\SkipAction.cpp" />
<ClCompile Include="VideoCommon\GraphicsModSystem\Runtime\CustomPipeline.cpp" />
<ClCompile Include="VideoCommon\GraphicsModSystem\Runtime\CustomShaderCache.cpp" />

View File

@ -89,7 +89,7 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
// in your translation, please use the type of curly quotes that's appropriate for
// your language. If you aren't sure which type is appropriate, see
// https://en.wikipedia.org/wiki/Quotation_mark#Specific_language_features
tr("\u00A9 2003-2015+ Dolphin Team. \u201cGameCube\u201d and \u201cWii\u201d are "
tr("\u00A9 2003-2024+ Dolphin Team. \u201cGameCube\u201d and \u201cWii\u201d are "
"trademarks of Nintendo. Dolphin is not affiliated with Nintendo in any way.")));
QLabel* logo = new QLabel();

View File

@ -194,7 +194,7 @@ void GeneralPane::CreateAutoUpdate()
auto_update_group_layout->addRow(tr("&Auto Update:"), m_combobox_update_track);
for (const QString& option :
{tr("Don't Update"), tr("Beta (once a month)"), tr("Dev (multiple times a day)")})
{tr("Don't Update"), tr("Releases (every few months)"), tr("Dev (multiple times a day)")})
m_combobox_update_track->addItem(option);
}

View File

@ -85,6 +85,8 @@ add_library(videocommon
GraphicsModSystem/Runtime/Actions/PrintAction.h
GraphicsModSystem/Runtime/Actions/ScaleAction.cpp
GraphicsModSystem/Runtime/Actions/ScaleAction.h
GraphicsModSystem/Runtime/Actions/SetSettingsAction.cpp
GraphicsModSystem/Runtime/Actions/SetSettingsAction.h
GraphicsModSystem/Runtime/Actions/SkipAction.cpp
GraphicsModSystem/Runtime/Actions/SkipAction.h
GraphicsModSystem/Runtime/CustomPipeline.cpp

View File

@ -0,0 +1,102 @@
// Copyright 2023 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "VideoCommon/GraphicsModSystem/Runtime/Actions/SetSettingsAction.h"
#include "Common/Config/Config.h"
#include "Core/Config/GraphicsSettings.h"
std::unique_ptr<SetSettingsAction> SetSettingsAction::Create(const picojson::value& json_data)
{
SetSettingsAction::Setting setting;
bool value = false;
const auto& setting_name = json_data.get("setting_name");
if (setting_name.is<std::string>())
{
std::string setting_name_str = setting_name.to_str();
if (setting_name_str == "skip_efb_to_ram")
{
setting = SetSettingsAction::Setting::Setting_Skip_EFB_To_Ram;
value = Config::Get<bool>(Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM);
}
else if (setting_name_str == "skip_xfb_to_ram")
{
setting = SetSettingsAction::Setting::Setting_Skip_XFB_To_Ram;
value = Config::Get<bool>(Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM);
}
else
{
return nullptr;
}
const auto& setting_value = json_data.get("setting_value");
if (setting_value.is<bool>())
{
value = setting_value.get<bool>();
}
}
return std::make_unique<SetSettingsAction>(setting, value);
}
SetSettingsAction::SetSettingsAction(Setting setting, bool value)
: m_setting(setting), m_value(value)
{
}
void SetSettingsAction::OnDrawStarted(GraphicsModActionData::DrawStarted* draw_started)
{
if (!draw_started) [[unlikely]]
return;
if (m_setting == Setting::Setting_Skip_EFB_To_Ram)
{
Config::SetBaseOrCurrent(Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM, m_value);
}
else if (m_setting == Setting::Setting_Skip_XFB_To_Ram)
{
Config::SetBaseOrCurrent(Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM, m_value);
}
}
void SetSettingsAction::OnTextureLoad(GraphicsModActionData::TextureLoad* texture_load)
{
if (!texture_load) [[unlikely]]
return;
if (m_setting == Setting::Setting_Skip_EFB_To_Ram)
{
Config::SetBaseOrCurrent(Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM, m_value);
}
else if (m_setting == Setting::Setting_Skip_XFB_To_Ram)
{
Config::SetBaseOrCurrent(Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM, m_value);
}
}
void SetSettingsAction::OnEFB(GraphicsModActionData::EFB* efb)
{
if (!efb) [[unlikely]]
return;
if (!efb->force_copy_to_ram) [[unlikely]]
return;
if (m_setting == Setting::Setting_Skip_EFB_To_Ram)
{
*efb->force_copy_to_ram = !m_value;
}
}
void SetSettingsAction::OnXFB(GraphicsModActionData::XFB* xfb)
{
if (!xfb) [[unlikely]]
return;
if (!xfb->force_copy_to_ram) [[unlikely]]
return;
if (m_setting == Setting::Setting_Skip_XFB_To_Ram)
{
*xfb->force_copy_to_ram = !m_value;
}
}

View File

@ -0,0 +1,34 @@
// Copyright 2023 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <memory>
#include <optional>
#include <picojson.h>
#include "VideoCommon/GraphicsModSystem/Runtime/GraphicsModAction.h"
class SetSettingsAction final : public GraphicsModAction
{
public:
enum class Setting
{
Setting_Invalid,
Setting_Skip_EFB_To_Ram,
Setting_Skip_XFB_To_Ram
};
static std::unique_ptr<SetSettingsAction> Create(const picojson::value& json_data);
SetSettingsAction(Setting setting, bool value);
void OnDrawStarted(GraphicsModActionData::DrawStarted*) override;
void OnTextureLoad(GraphicsModActionData::TextureLoad*) override;
void OnEFB(GraphicsModActionData::EFB*) override;
void OnXFB(GraphicsModActionData::XFB*) override;
private:
Setting m_setting;
bool m_value;
};

View File

@ -17,7 +17,7 @@ public:
virtual void OnDrawStarted(GraphicsModActionData::DrawStarted*) {}
virtual void OnEFB(GraphicsModActionData::EFB*) {}
virtual void OnXFB() {}
virtual void OnXFB(GraphicsModActionData::XFB*) {}
virtual void OnProjection(GraphicsModActionData::Projection*) {}
virtual void OnProjectionAndTexture(GraphicsModActionData::Projection*) {}
virtual void OnTextureLoad(GraphicsModActionData::TextureLoad*) {}

View File

@ -32,6 +32,12 @@ struct EFB
bool* skip;
u32* scaled_width;
u32* scaled_height;
bool* force_copy_to_ram;
};
struct XFB
{
bool* force_copy_to_ram;
};
struct Projection

View File

@ -7,6 +7,7 @@
#include "VideoCommon/GraphicsModSystem/Runtime/Actions/MoveAction.h"
#include "VideoCommon/GraphicsModSystem/Runtime/Actions/PrintAction.h"
#include "VideoCommon/GraphicsModSystem/Runtime/Actions/ScaleAction.h"
#include "VideoCommon/GraphicsModSystem/Runtime/Actions/SetSettingsAction.h"
#include "VideoCommon/GraphicsModSystem/Runtime/Actions/SkipAction.h"
namespace GraphicsModActionFactory
@ -34,6 +35,10 @@ std::unique_ptr<GraphicsModAction> Create(std::string_view name, const picojson:
{
return CustomPipelineAction::Create(json_data, std::move(library));
}
else if (name == "set_settings")
{
return SetSettingsAction::Create(json_data);
}
return nullptr;
}

View File

@ -2305,21 +2305,33 @@ void TextureCacheBase::CopyRenderTargetToTexture(
info.m_width = tex_w;
info.m_height = tex_h;
info.m_texture_format = baseFormat;
bool force_copy_to_ram = false;
if (is_xfb_copy)
{
GraphicsModActionData::XFB xfb{&force_copy_to_ram};
for (const auto& action : g_graphics_mod_manager->GetXFBActions(info))
{
action->OnXFB();
action->OnXFB(&xfb);
}
if (force_copy_to_ram)
{
copy_to_ram = true;
}
}
else
{
bool skip = false;
GraphicsModActionData::EFB efb{tex_w, tex_h, &skip, &scaled_tex_w, &scaled_tex_h};
GraphicsModActionData::EFB efb{tex_w, tex_h, &skip,
&scaled_tex_w, &scaled_tex_h, &force_copy_to_ram};
for (const auto& action : g_graphics_mod_manager->GetEFBActions(info))
{
action->OnEFB(&efb);
}
if (force_copy_to_ram)
{
copy_to_ram = true;
}
if (skip == true)
{
if (copy_to_ram)