Skip to content

Commit

Permalink
Warn about the high performance cost of JINC2 and xBR filtering
Browse files Browse the repository at this point in the history
These options (especially xBR) have a very high cost. In my experience,
xBR has a greater impact on the framerate than enabling 4× SSAA or PGXP
in CPU mode (whose quality increase is much more obvious).

These options are also essentially unusable on mobile, regardless of
how powerful your device is. As a result, this adds warnings both
in the option names and the description.

Bilinear filtering is not affected by this performance cost, as GPUs
can perform this in hardware without having to emulate filtering
through a shader.
  • Loading branch information
Calinou committed Sep 22, 2022
1 parent d26fef3 commit 8152b99
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/core/settings.cpp
Expand Up @@ -886,9 +886,9 @@ static constexpr auto s_texture_filter_names =
make_array("Nearest", "Bilinear", "BilinearBinAlpha", "JINC2", "JINC2BinAlpha", "xBR", "xBRBinAlpha");
static constexpr auto s_texture_filter_display_names =
make_array(TRANSLATABLE("GPUTextureFilter", "Nearest-Neighbor"), TRANSLATABLE("GPUTextureFilter", "Bilinear"),
TRANSLATABLE("GPUTextureFilter", "Bilinear (No Edge Blending)"), TRANSLATABLE("GPUTextureFilter", "JINC2"),
TRANSLATABLE("GPUTextureFilter", "JINC2 (No Edge Blending)"), TRANSLATABLE("GPUTextureFilter", "xBR"),
TRANSLATABLE("GPUTextureFilter", "xBR (No Edge Blending)"));
TRANSLATABLE("GPUTextureFilter", "Bilinear (No Edge Blending)"), TRANSLATABLE("GPUTextureFilter", "JINC2 (Slow)"),
TRANSLATABLE("GPUTextureFilter", "JINC2 (Slow, No Edge Blending)"), TRANSLATABLE("GPUTextureFilter", "xBR (Very Slow)"),
TRANSLATABLE("GPUTextureFilter", "xBR (Very Slow, No Edge Blending)"));

std::optional<GPUTextureFilter> Settings::ParseTextureFilterName(const char* str)
{
Expand Down
4 changes: 2 additions & 2 deletions src/duckstation-qt/enhancementsettingswidget.cpp
Expand Up @@ -85,8 +85,8 @@ EnhancementSettingsWidget::EnhancementSettingsWidget(SettingsDialog* dialog, QWi
dialog->registerWidgetHelp(
m_ui.textureFiltering, tr("Texture Filtering"),
qApp->translate("GPUTextureFilter", Settings::GetTextureFilterDisplayName(GPUTextureFilter::Nearest)),
tr("Smooths out the blockyness of magnified textures on 3D object by using filtering. <br>Will have a "
"greater effect on higher resolution scales. Only applies to the hardware renderers."));
tr("Smooths out the blockiness of magnified textures on 3D object by using filtering. <br>Will have a "
"greater effect on higher resolution scales. Only applies to the hardware renderers. <br>The JINC2 and especially xBR filtering modes are very demanding, and may not be worth the speed penalty."));
dialog->registerWidgetHelp(
m_ui.widescreenHack, tr("Widescreen Hack"), tr("Unchecked"),
tr("Scales vertex positions in screen-space to a widescreen aspect ratio, essentially "
Expand Down
5 changes: 3 additions & 2 deletions src/frontend-common/fullscreen_ui.cpp
Expand Up @@ -3362,8 +3362,9 @@ void FullscreenUI::DrawDisplaySettingsPage()
"ResolutionScale", 1, resolution_scales.data(), resolution_scales.size(), 0, is_hardware);

DrawEnumSetting(bsi, "Texture Filtering",
"Smooths out the blockyness of magnified textures on 3D objects. Will have a greater effect "
"on higher resolution scales.",
"Smooths out the blockiness of magnified textures on 3D objects. Will have a greater effect "
"on higher resolution scales. The JINC2 and especially xBR filtering modes are very demanding,"
"and may not be worth the speed penalty.",
"GPU", "TextureFilter", Settings::DEFAULT_GPU_TEXTURE_FILTER, &Settings::ParseTextureFilterName,
&Settings::GetTextureFilterName, &Settings::GetTextureFilterDisplayName, GPUTextureFilter::Count,
is_hardware);
Expand Down

0 comments on commit 8152b99

Please sign in to comment.