Optimize SpiriV output
This commit is contained in:
parent
bd2f935c4d
commit
38737f26e5
13 changed files with 62 additions and 1 deletions
|
@ -18,6 +18,7 @@ enum class IntSetting(override val key: String) : AbstractIntSetting {
|
||||||
RENDERER_ANTI_ALIASING("anti_aliasing"),
|
RENDERER_ANTI_ALIASING("anti_aliasing"),
|
||||||
RENDERER_SCREEN_LAYOUT("screen_layout"),
|
RENDERER_SCREEN_LAYOUT("screen_layout"),
|
||||||
RENDERER_ASPECT_RATIO("aspect_ratio"),
|
RENDERER_ASPECT_RATIO("aspect_ratio"),
|
||||||
|
RENDERER_OPTIMIZE_SPIRV_OUTPUT("optimize_spirv_output"),
|
||||||
AUDIO_OUTPUT_ENGINE("output_engine"),
|
AUDIO_OUTPUT_ENGINE("output_engine"),
|
||||||
MAX_ANISOTROPY("max_anisotropy"),
|
MAX_ANISOTROPY("max_anisotropy"),
|
||||||
THEME("theme"),
|
THEME("theme"),
|
||||||
|
|
|
@ -120,4 +120,15 @@ object Settings {
|
||||||
entries.firstOrNull { it.int == int } ?: Center
|
entries.firstOrNull { it.int == int } ?: Center
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum class OptimizeSpirvOutput(val int: Int) {
|
||||||
|
Never(0),
|
||||||
|
OnLoad(1),
|
||||||
|
Always(2);
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun from(int: Int): OptimizeSpirvOutput =
|
||||||
|
entries.firstOrNull { it.int == int } ?: OnLoad
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -368,6 +368,15 @@ abstract class SettingsItem(
|
||||||
descriptionId = R.string.renderer_force_max_clock_description
|
descriptionId = R.string.renderer_force_max_clock_description
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
put(
|
||||||
|
SingleChoiceSetting(
|
||||||
|
IntSetting.RENDERER_OPTIMIZE_SPIRV_OUTPUT,
|
||||||
|
titleId = R.string.renderer_optimize_spirv_output,
|
||||||
|
descriptionId = 0,
|
||||||
|
choicesId = R.array.optimizeSpirvOutputEntries,
|
||||||
|
valuesId = R.array.optimizeSpirvOutputValues
|
||||||
|
)
|
||||||
|
)
|
||||||
put(
|
put(
|
||||||
SwitchSetting(
|
SwitchSetting(
|
||||||
BooleanSetting.RENDERER_ASYNCHRONOUS_SHADERS,
|
BooleanSetting.RENDERER_ASYNCHRONOUS_SHADERS,
|
||||||
|
|
|
@ -182,6 +182,7 @@ class SettingsFragmentPresenter(
|
||||||
add(IntSetting.RENDERER_SCREEN_LAYOUT.key)
|
add(IntSetting.RENDERER_SCREEN_LAYOUT.key)
|
||||||
add(IntSetting.RENDERER_ASPECT_RATIO.key)
|
add(IntSetting.RENDERER_ASPECT_RATIO.key)
|
||||||
add(IntSetting.VERTICAL_ALIGNMENT.key)
|
add(IntSetting.VERTICAL_ALIGNMENT.key)
|
||||||
|
add(IntSetting.RENDERER_OPTIMIZE_SPIRV_OUTPUT.key)
|
||||||
add(BooleanSetting.PICTURE_IN_PICTURE.key)
|
add(BooleanSetting.PICTURE_IN_PICTURE.key)
|
||||||
add(BooleanSetting.RENDERER_USE_DISK_SHADER_CACHE.key)
|
add(BooleanSetting.RENDERER_USE_DISK_SHADER_CACHE.key)
|
||||||
add(BooleanSetting.RENDERER_FORCE_MAX_CLOCK.key)
|
add(BooleanSetting.RENDERER_FORCE_MAX_CLOCK.key)
|
||||||
|
|
|
@ -326,4 +326,15 @@
|
||||||
<item>2</item>
|
<item>2</item>
|
||||||
</integer-array>
|
</integer-array>
|
||||||
|
|
||||||
|
<string-array name="optimizeSpirvOutputEntries">
|
||||||
|
<item>@string/never</item>
|
||||||
|
<item>@string/on_load</item>
|
||||||
|
<item>@string/always</item>
|
||||||
|
</string-array>
|
||||||
|
<integer-array name="optimizeSpirvOutputValues">
|
||||||
|
<item>0</item>
|
||||||
|
<item>1</item>
|
||||||
|
<item>2</item>
|
||||||
|
</integer-array>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -249,6 +249,7 @@
|
||||||
<string name="renderer_anti_aliasing">Anti-aliasing method</string>
|
<string name="renderer_anti_aliasing">Anti-aliasing method</string>
|
||||||
<string name="renderer_force_max_clock">Force maximum clocks (Adreno only)</string>
|
<string name="renderer_force_max_clock">Force maximum clocks (Adreno only)</string>
|
||||||
<string name="renderer_force_max_clock_description">Forces the GPU to run at the maximum possible clocks (thermal constraints will still be applied).</string>
|
<string name="renderer_force_max_clock_description">Forces the GPU to run at the maximum possible clocks (thermal constraints will still be applied).</string>
|
||||||
|
<string name="renderer_optimize_spirv_output">Optimize SPIRV output</string>
|
||||||
<string name="renderer_asynchronous_shaders">Use asynchronous shaders</string>
|
<string name="renderer_asynchronous_shaders">Use asynchronous shaders</string>
|
||||||
<string name="renderer_asynchronous_shaders_description">Compiles shaders asynchronously, reducing stutter but may introduce glitches.</string>
|
<string name="renderer_asynchronous_shaders_description">Compiles shaders asynchronously, reducing stutter but may introduce glitches.</string>
|
||||||
<string name="renderer_reactive_flushing">Use reactive flushing</string>
|
<string name="renderer_reactive_flushing">Use reactive flushing</string>
|
||||||
|
@ -680,6 +681,11 @@
|
||||||
<string name="center">Center</string>
|
<string name="center">Center</string>
|
||||||
<string name="bottom">Bottom</string>
|
<string name="bottom">Bottom</string>
|
||||||
|
|
||||||
|
<!-- Optimize SPIRV output -->
|
||||||
|
<string name="never">Never</string>
|
||||||
|
<string name="on_load">On Load</string>
|
||||||
|
<string name="always">Always</string>
|
||||||
|
|
||||||
<!-- Licenses screen strings -->
|
<!-- Licenses screen strings -->
|
||||||
<string name="licenses">Licenses</string>
|
<string name="licenses">Licenses</string>
|
||||||
<string name="license_fidelityfx_fsr" translatable="false">FidelityFX-FSR</string>
|
<string name="license_fidelityfx_fsr" translatable="false">FidelityFX-FSR</string>
|
||||||
|
|
|
@ -52,6 +52,7 @@ SWITCHABLE(NvdecEmulation, false);
|
||||||
SWITCHABLE(Region, true);
|
SWITCHABLE(Region, true);
|
||||||
SWITCHABLE(RendererBackend, true);
|
SWITCHABLE(RendererBackend, true);
|
||||||
SWITCHABLE(ScalingFilter, false);
|
SWITCHABLE(ScalingFilter, false);
|
||||||
|
SWITCHABLE(SpirvOptimizeMode, true);
|
||||||
SWITCHABLE(ShaderBackend, true);
|
SWITCHABLE(ShaderBackend, true);
|
||||||
SWITCHABLE(TimeZone, true);
|
SWITCHABLE(TimeZone, true);
|
||||||
SETTING(VSyncMode, true);
|
SETTING(VSyncMode, true);
|
||||||
|
|
|
@ -73,6 +73,7 @@ SWITCHABLE(NvdecEmulation, false);
|
||||||
SWITCHABLE(Region, true);
|
SWITCHABLE(Region, true);
|
||||||
SWITCHABLE(RendererBackend, true);
|
SWITCHABLE(RendererBackend, true);
|
||||||
SWITCHABLE(ScalingFilter, false);
|
SWITCHABLE(ScalingFilter, false);
|
||||||
|
SWITCHABLE(SpirvOptimizeMode, true);
|
||||||
SWITCHABLE(ShaderBackend, true);
|
SWITCHABLE(ShaderBackend, true);
|
||||||
SWITCHABLE(TimeZone, true);
|
SWITCHABLE(TimeZone, true);
|
||||||
SETTING(VSyncMode, true);
|
SETTING(VSyncMode, true);
|
||||||
|
@ -281,6 +282,12 @@ struct Values {
|
||||||
#endif
|
#endif
|
||||||
SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache",
|
SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache",
|
||||||
Category::Renderer};
|
Category::Renderer};
|
||||||
|
SwitchableSetting<SpirvOptimizeMode, true> optimize_spirv_output{linkage,
|
||||||
|
SpirvOptimizeMode::OnLoad,
|
||||||
|
SpirvOptimizeMode::Never,
|
||||||
|
SpirvOptimizeMode::Always,
|
||||||
|
"optimize_spirv_output",
|
||||||
|
Category::Renderer};
|
||||||
SwitchableSetting<bool> use_asynchronous_gpu_emulation{
|
SwitchableSetting<bool> use_asynchronous_gpu_emulation{
|
||||||
linkage, true, "use_asynchronous_gpu_emulation", Category::Renderer};
|
linkage, true, "use_asynchronous_gpu_emulation", Category::Renderer};
|
||||||
SwitchableSetting<AstcDecodeMode, true> accelerate_astc{linkage,
|
SwitchableSetting<AstcDecodeMode, true> accelerate_astc{linkage,
|
||||||
|
|
|
@ -155,6 +155,8 @@ ENUM(ConsoleMode, Handheld, Docked);
|
||||||
|
|
||||||
ENUM(AppletMode, HLE, LLE);
|
ENUM(AppletMode, HLE, LLE);
|
||||||
|
|
||||||
|
ENUM(SpirvOptimizeMode, Never, OnLoad, Always);
|
||||||
|
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
inline std::string CanonicalizeEnum(Type id) {
|
inline std::string CanonicalizeEnum(Type id) {
|
||||||
const auto group = EnumMetadata<Type>::Canonicalizations();
|
const auto group = EnumMetadata<Type>::Canonicalizations();
|
||||||
|
|
|
@ -73,6 +73,7 @@ private:
|
||||||
VideoCore::ShaderNotify& shader_notify;
|
VideoCore::ShaderNotify& shader_notify;
|
||||||
const bool use_asynchronous_shaders;
|
const bool use_asynchronous_shaders;
|
||||||
const bool strict_context_required;
|
const bool strict_context_required;
|
||||||
|
bool optimize_spirv_output{};
|
||||||
|
|
||||||
GraphicsPipelineKey graphics_key{};
|
GraphicsPipelineKey graphics_key{};
|
||||||
GraphicsPipeline* current_pipeline{};
|
GraphicsPipeline* current_pipeline{};
|
||||||
|
|
|
@ -150,6 +150,7 @@ private:
|
||||||
VideoCore::ShaderNotify& shader_notify;
|
VideoCore::ShaderNotify& shader_notify;
|
||||||
bool use_asynchronous_shaders{};
|
bool use_asynchronous_shaders{};
|
||||||
bool use_vulkan_pipeline_cache{};
|
bool use_vulkan_pipeline_cache{};
|
||||||
|
bool optimize_spirv_output{};
|
||||||
|
|
||||||
GraphicsPipelineCacheKey graphics_key{};
|
GraphicsPipelineCacheKey graphics_key{};
|
||||||
GraphicsPipeline* current_pipeline{};
|
GraphicsPipeline* current_pipeline{};
|
||||||
|
|
|
@ -147,6 +147,10 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) {
|
||||||
tr("Allows saving shaders to storage for faster loading on following game "
|
tr("Allows saving shaders to storage for faster loading on following game "
|
||||||
"boots.\nDisabling "
|
"boots.\nDisabling "
|
||||||
"it is only intended for debugging."));
|
"it is only intended for debugging."));
|
||||||
|
INSERT(Settings, optimize_spirv_output, tr("Optimize SPIRV output shader"),
|
||||||
|
tr("Runs an additional optimization pass over generated SPIRV shaders.\n"
|
||||||
|
"Will increase time required for shader compilation.\nMay slightly improve "
|
||||||
|
"performance.\nThis feature is experimental."));
|
||||||
INSERT(
|
INSERT(
|
||||||
Settings, use_asynchronous_gpu_emulation, tr("Use asynchronous GPU emulation"),
|
Settings, use_asynchronous_gpu_emulation, tr("Use asynchronous GPU emulation"),
|
||||||
tr("Uses an extra CPU thread for rendering.\nThis option should always remain enabled."));
|
tr("Uses an extra CPU thread for rendering.\nThis option should always remain enabled."));
|
||||||
|
@ -310,7 +314,12 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) {
|
||||||
PAIR(AppletMode, HLE, tr("Custom frontend")),
|
PAIR(AppletMode, HLE, tr("Custom frontend")),
|
||||||
PAIR(AppletMode, LLE, tr("Real applet")),
|
PAIR(AppletMode, LLE, tr("Real applet")),
|
||||||
}});
|
}});
|
||||||
|
translations->insert({Settings::EnumMetadata<Settings::SpirvOptimizeMode>::Index(),
|
||||||
|
{
|
||||||
|
PAIR(SpirvOptimizeMode, Never, tr("Never")),
|
||||||
|
PAIR(SpirvOptimizeMode, OnLoad, tr("On Load")),
|
||||||
|
PAIR(SpirvOptimizeMode, Always, tr("Always")),
|
||||||
|
}});
|
||||||
translations->insert({Settings::EnumMetadata<Settings::AstcDecodeMode>::Index(),
|
translations->insert({Settings::EnumMetadata<Settings::AstcDecodeMode>::Index(),
|
||||||
{
|
{
|
||||||
PAIR(AstcDecodeMode, Cpu, tr("CPU")),
|
PAIR(AstcDecodeMode, Cpu, tr("CPU")),
|
||||||
|
|
|
@ -277,3 +277,4 @@ Q_DECLARE_METATYPE(Settings::RendererBackend);
|
||||||
Q_DECLARE_METATYPE(Settings::ShaderBackend);
|
Q_DECLARE_METATYPE(Settings::ShaderBackend);
|
||||||
Q_DECLARE_METATYPE(Settings::AstcRecompression);
|
Q_DECLARE_METATYPE(Settings::AstcRecompression);
|
||||||
Q_DECLARE_METATYPE(Settings::AstcDecodeMode);
|
Q_DECLARE_METATYPE(Settings::AstcDecodeMode);
|
||||||
|
Q_DECLARE_METATYPE(Settings::SpirvOptimizeMode);
|
Loading…
Add table
Add a link
Reference in a new issue