Remove non-integer IRs

This commit is contained in:
JosJuice 2017-07-03 16:32:02 +02:00
parent a25f7b9b4c
commit f090a94319
45 changed files with 75 additions and 266 deletions

View File

@ -18,7 +18,6 @@ EmulationIssues =
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
SafeTextureCacheColorSamples = 512
[Video_Enhancements]

View File

@ -21,8 +21,5 @@ EmulationIssues = Needs Efb to Ram for BBox (proper graphics).
EFBToTextureEnable = False
BBoxEnable = True
[Video_Settings]
EFBScale = -1
[Video_Stereoscopy]
StereoConvergence = 545

View File

@ -19,6 +19,6 @@ EmulationIssues = Use directx11 backend with efb scale set at 1x to deal with bl
[Video_Settings]
SafeTextureCacheColorSamples = 0
EFBScale = 2
InternalResolution = 1
MSAA = 0
MaxAnisotropy = 0

View File

@ -17,8 +17,5 @@ EmulationIssues =
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
[Video_Stereoscopy]
StereoConvergence = 64

View File

@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues = If EFB scale is not integral, serious texture glitches occur.
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
@ -18,7 +18,4 @@ EmulationIssues = If EFB scale is not integral, serious texture glitches occur.
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
SafeTextureCacheColorSamples = 0

View File

@ -21,4 +21,3 @@ EmulationIssues =
UseXFB = True
UseRealXFB = False
SafeTextureCacheColorSamples = 512
EFBScale = -1

View File

@ -7,7 +7,7 @@ FPRF = True
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues = EFB must be an integer (integral, 1x, 2x, 3x).
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
@ -19,8 +19,6 @@ EmulationIssues = EFB must be an integer (integral, 1x, 2x, 3x).
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
SafeTextureCacheColorSamples = 512
[Video_Hacks]

View File

@ -16,7 +16,3 @@ EmulationIssues =
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1

View File

@ -7,7 +7,7 @@ SyncGPU = True
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues = HLE music fades in and out. If EFB scale is not integral, 1x, 2x or 3x serious texture glitches occur
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
@ -19,5 +19,4 @@ EmulationIssues = HLE music fades in and out. If EFB scale is not integral, 1x,
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
SafeTextureCacheColorSamples = 0

View File

@ -19,7 +19,6 @@ EmulationIssues =
[Video_Settings]
SafeTextureCacheColorSamples = 512
EFBScale = -1
[Video_Enhancements]
ForceFiltering = False

View File

@ -6,7 +6,7 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues = Needs integral scaling for the black lines to disappear.
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
@ -18,6 +18,4 @@ EmulationIssues = Needs integral scaling for the black lines to disappear.
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
SafeTextureCacheColorSamples = 512

View File

@ -18,5 +18,4 @@ EmulationIssues = Jerky videos need safe cache.
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
SafeTextureCacheColorSamples = 512

View File

@ -16,7 +16,3 @@ EmulationIssues =
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1

View File

@ -17,9 +17,6 @@ EmulationIssues = USB Microphone not emulated
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
[Video_Enhancements]
MaxAnisotropy = 0
ForceFiltering = False

View File

@ -21,7 +21,6 @@ EmulationIssues =
UseXFB = True
UseRealXFB = False
SafeTextureCacheColorSamples = 0
EFBScale = -1
[Video_Hacks]
EFBToTextureEnable = False

View File

@ -5,8 +5,8 @@
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationIssues = Skip any errors at startup and use integral efb scale.
EmulationStateId = 4
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
@ -18,6 +18,4 @@ EmulationStateId = 4
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
SafeTextureCacheColorSamples = 512

View File

@ -18,7 +18,6 @@ EmulationIssues =
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
SafeTextureCacheColorSamples = 512
[Video_Enhancements]

View File

@ -21,7 +21,6 @@ EmulationIssues =
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
SafeTextureCacheColorSamples = 512
[Video_Enhancements]

View File

@ -17,9 +17,6 @@ EmulationIssues =
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
[Video_Enhancements]
MaxAnisotropy = 0
ForceFiltering = False

View File

@ -18,7 +18,6 @@ EmulationIssues = Enable progressive scan if the game has boot issues.
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
SafeTextureCacheColorSamples = 0
[Video_Enhancements]

View File

@ -18,6 +18,5 @@ EmulationIssues = Enable progressive scan if the game has boot issues.
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
SafeTextureCacheColorSamples = 0

View File

@ -18,7 +18,6 @@ EmulationIssues =
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
SafeTextureCacheColorSamples = 512
[Video_Enhancements]

View File

@ -21,7 +21,6 @@ EmulationIssues =
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
SafeTextureCacheColorSamples = 512
[Video_Enhancements]

View File

@ -17,9 +17,6 @@ EmulationIssues =
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
[Video_Enhancements]
MaxAnisotropy = 0
ForceFiltering = False

View File

@ -17,9 +17,6 @@ EmulationIssues =
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
[Video_Enhancements]
MaxAnisotropy = 0
ForceFiltering = False

View File

@ -17,9 +17,6 @@ EmulationStateId = 5
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
EFBScale = -1
[Video_Hacks]
EFBAccessEnable = False

View File

@ -20,7 +20,5 @@ EmulationIssues =
[Video_Settings]
UseXFB = True
UseRealXFB = False
EFBScale = -1
SafeTextureCacheColorSamples = 512

View File

@ -20,7 +20,4 @@ EmulationIssues =
[Video_Settings]
UseXFB = True
UseRealXFB = False
SafeTextureCacheColorSamples = 512
EFBScale = -1

View File

@ -56,7 +56,7 @@ public final class SettingsFile
public static final String KEY_AUDIO_STRETCH = "AudioStretch";
public static final String KEY_SHOW_FPS = "ShowFPS";
public static final String KEY_INTERNAL_RES = "EFBScale";
public static final String KEY_INTERNAL_RES = "InternalResolution";
public static final String KEY_FSAA = "MSAA";
public static final String KEY_ANISOTROPY = "MaxAnisotropy";
public static final String KEY_POST_SHADER = "PostProcessingShader";

View File

@ -104,23 +104,19 @@
<!-- Internal Resolution Preference -->
<string-array name="internalResolutionEntries" translatable="false">
<item>1x Native (640x528)</item>
<item>1.5x Native (960x792)</item>
<item>2x Native (1280x1056) for 720p</item>
<item>2.5x Native (1600x1320)</item>
<item>3x Native (1920x1584) for 1080p</item>
<item>4x Native (2560x2112)</item>
<item>5x Native (3200x2640)</item>
<item>6x Native (3840x3168) for 4K</item>
</string-array>
<integer-array name="internalResolutionValues" translatable="false">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
</integer-array>
<!-- FSAA Preference -->

View File

@ -224,10 +224,10 @@ void DolphinAnalytics::MakePerGameBuilder()
builder.AddData("cfg-gfx-vsync", g_Config.bVSync);
builder.AddData("cfg-gfx-aspect-ratio", g_Config.iAspectRatio);
builder.AddData("cfg-gfx-efb-access", g_Config.bEFBAccessEnable);
builder.AddData("cfg-gfx-efb-scale", g_Config.iEFBScale);
builder.AddData("cfg-gfx-efb-copy-format-changes", g_Config.bEFBEmulateFormatChanges);
builder.AddData("cfg-gfx-efb-copy-ram", !g_Config.bSkipEFBCopyToRam);
builder.AddData("cfg-gfx-efb-copy-scaled", g_Config.bCopyEFBScaled);
builder.AddData("cfg-gfx-internal-resolution", g_Config.iEFBScale);
builder.AddData("cfg-gfx-tc-samples", g_Config.iSafeTextureCache_ColorSamples);
builder.AddData("cfg-gfx-stereo-mode", g_Config.iStereoMode);
builder.AddData("cfg-gfx-per-pixel-lighting", g_Config.bEnablePixelLighting);

View File

@ -60,8 +60,7 @@ const ConfigInfo<bool> GFX_ENABLE_PIXEL_LIGHTING{{System::GFX, "Settings", "Enab
const ConfigInfo<bool> GFX_FAST_DEPTH_CALC{{System::GFX, "Settings", "FastDepthCalc"}, true};
const ConfigInfo<u32> GFX_MSAA{{System::GFX, "Settings", "MSAA"}, 1};
const ConfigInfo<bool> GFX_SSAA{{System::GFX, "Settings", "SSAA"}, false};
const ConfigInfo<int> GFX_EFB_SCALE{{System::GFX, "Settings", "EFBScale"},
static_cast<int>(SCALE_1X)};
const ConfigInfo<int> GFX_EFB_SCALE{{System::GFX, "Settings", "InternalResolution"}, 1};
const ConfigInfo<bool> GFX_TEXFMT_OVERLAY_ENABLE{{System::GFX, "Settings", "TexFmtOverlayEnable"},
false};
const ConfigInfo<bool> GFX_TEXFMT_OVERLAY_CENTER{{System::GFX, "Settings", "TexFmtOverlayCenter"},

View File

@ -84,7 +84,7 @@ static const INIToLocationMap& GetINIToLocationMap()
{{"Video_Settings", "MSAA"}, {Config::GFX_MSAA.location}},
{{"Video_Settings", "SSAA"}, {Config::GFX_SSAA.location}},
{{"Video_Settings", "ForceTrueColor"}, {Config::GFX_ENHANCE_FORCE_TRUE_COLOR.location}},
{{"Video_Settings", "EFBScale"}, {Config::GFX_EFB_SCALE.location}},
{{"Video_Settings", "InternalResolution"}, {Config::GFX_EFB_SCALE.location}},
{{"Video_Settings", "DisableFog"}, {Config::GFX_DISABLE_FOG.location}},
{{"Video_Settings", "BackendMultithreading"}, {Config::GFX_BACKEND_MULTITHREADING.location}},
{{"Video_Settings", "CommandBufferExecuteInterval"},

View File

@ -43,16 +43,15 @@ void EnhancementsWidget::CreateWidgets()
auto* enhancements_layout = new QGridLayout();
enhancements_box->setLayout(enhancements_layout);
m_ir_combo = new GraphicsChoice(
{tr("Auto (Window Size)"), tr("Auto (Multiple of 640x528)"), tr("Native (640x528)"),
tr("1.5x Native (960x792)"), tr("2x Native (1280x1056) for 720p"),
tr("2.5x Native (1600x1320)"), tr("3x Native (1920x1584) for 1080p"),
tr("4x Native (2560x2112) for 1440p"), tr("5x Native (3200x2640)"),
tr("6x Native (3840x3168) for 4K"), tr("7x Native (4480x3696)"),
tr("8x Native (5120x4224) for 5K")},
Config::GFX_EFB_SCALE);
m_ir_combo = new GraphicsChoice({tr("Auto (Multiple of 640x528)"), tr("Native (640x528)"),
tr("2x Native (1280x1056) for 720p"),
tr("3x Native (1920x1584) for 1080p"),
tr("4x Native (2560x2112) for 1440p"),
tr("5x Native (3200x2640)"), tr("6x Native (3840x3168) for 4K"),
tr("7x Native (4480x3696)"), tr("8x Native (5120x4224) for 5K")},
Config::GFX_EFB_SCALE);
if (g_Config.iEFBScale > 11)
if (g_Config.iEFBScale > 8)
{
m_ir_combo->addItem(tr("Custom"));
m_ir_combo->setCurrentIndex(m_ir_combo->count() - 1);
@ -221,10 +220,8 @@ void EnhancementsWidget::AddDescriptions()
static const char* TR_INTERNAL_RESOLUTION_DESCRIPTION =
QT_TR_NOOP("Specifies the resolution used to render at. A high resolution greatly improves "
"visual quality, but also greatly increases GPU load and can cause issues in "
"certain games.\n\"Multiple of 640x528\" will result in a size slightly larger "
"than \"Window Size\" but yield fewer issues. Generally speaking, the lower the "
"internal resolution is, the better your performance will be. Auto (Window Size), "
"1.5x, and 2.5x may cause issues in some games.\n\nIf unsure, select Native.");
"certain games. Generally speaking, the lower the internal resolution is, the "
"better your performance will be.\n\nIf unsure, select Native.");
static const char* TR_ANTIALIAS_DESCRIPTION =
QT_TR_NOOP("Reduces the amount of aliasing caused by rasterizing 3D graphics. This smooths "

View File

@ -207,7 +207,7 @@ void HotkeyScheduler::Run()
if (IsHotkey(HK_INCREASE_IR))
++g_Config.iEFBScale;
if (IsHotkey(HK_DECREASE_IR))
g_Config.iEFBScale = std::max(g_Config.iEFBScale - 1, static_cast<int>(SCALE_AUTO));
g_Config.iEFBScale = std::max(g_Config.iEFBScale - 1, EFB_SCALE_AUTO_INTEGRAL);
if (IsHotkey(HK_TOGGLE_CROP))
g_Config.bCrop = !g_Config.bCrop;
if (IsHotkey(HK_TOGGLE_AR))

View File

@ -1446,7 +1446,7 @@ void CFrame::ParseHotkeys()
if (IsHotkey(HK_DECREASE_IR))
{
OSDChoice = 1;
if (Config::Get(Config::GFX_EFB_SCALE) > SCALE_AUTO)
if (Config::Get(Config::GFX_EFB_SCALE) > EFB_SCALE_AUTO_INTEGRAL)
Config::SetCurrent(Config::GFX_EFB_SCALE, Config::Get(Config::GFX_EFB_SCALE) - 1);
}
if (IsHotkey(HK_TOGGLE_CROP))

View File

@ -186,10 +186,8 @@ static wxString borderless_fullscreen_desc = wxTRANSLATE(
static wxString internal_res_desc =
wxTRANSLATE("Specifies the resolution used to render at. A high resolution greatly improves "
"visual quality, but also greatly increases GPU load and can cause issues in "
"certain games.\n\"Multiple of 640x528\" will result in a size slightly larger "
"than \"Window Size\" but yield fewer issues. Generally speaking, the lower the "
"internal resolution is, the better your performance will be. Auto (Window Size), "
"1.5x, and 2.5x may cause issues in some games.\n\nIf unsure, select Native.");
"certain games. Generally speaking, the lower the internal resolution is, the "
"better your performance will be.\n\nIf unsure, select Native.");
static wxString efb_access_desc =
wxTRANSLATE("Ignore any requests from the CPU to read from or write to the EFB.\nImproves "
"performance in some games, but might disable some gameplay-related features or "
@ -517,27 +515,20 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string& title)
// Internal resolution
{
const wxString efbscale_choices[] = {_("Auto (Window Size)"),
_("Auto (Multiple of 640x528)"),
_("Native (640x528)"),
_("1.5x Native (960x792)"),
_("2x Native (1280x1056) for 720p"),
_("2.5x Native (1600x1320)"),
_("3x Native (1920x1584) for 1080p"),
_("4x Native (2560x2112) for 1440p"),
_("5x Native (3200x2640)"),
_("6x Native (3840x3168) for 4K"),
_("7x Native (4480x3696)"),
_("8x Native (5120x4224) for 5K"),
_("Custom")};
const wxString efbscale_choices[] = {
_("Auto (Multiple of 640x528)"), _("Native (640x528)"),
_("2x Native (1280x1056) for 720p"), _("3x Native (1920x1584) for 1080p"),
_("4x Native (2560x2112) for 1440p"), _("5x Native (3200x2640)"),
_("6x Native (3840x3168) for 4K"), _("7x Native (4480x3696)"),
_("8x Native (5120x4224) for 5K"), _("Custom")};
wxChoice* const choice_efbscale = CreateChoice(
page_enh, Config::GFX_EFB_SCALE, wxGetTranslation(internal_res_desc),
(vconfig.iEFBScale > 11) ? ArraySize(efbscale_choices) : ArraySize(efbscale_choices) - 1,
(vconfig.iEFBScale > 8) ? ArraySize(efbscale_choices) : ArraySize(efbscale_choices) - 1,
efbscale_choices);
if (vconfig.iEFBScale > 11)
choice_efbscale->SetSelection(12);
if (vconfig.iEFBScale > 8)
choice_efbscale->SetSelection(9);
szr_enh->Add(new wxStaticText(page_enh, wxID_ANY, _("Internal Resolution:")),
wxGBPosition(row, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
@ -1120,7 +1111,7 @@ void VideoConfigDiag::OnUpdateUI(wxUpdateUIEvent& ev)
cache_hires_textures->Enable(vconfig.bHiresTextures);
// Vertex rounding
vertex_rounding_checkbox->Enable(vconfig.iEFBScale != SCALE_1X);
vertex_rounding_checkbox->Enable(vconfig.iEFBScale != 1);
// Repopulating the post-processing shaders can't be done from an event
if (choice_ppshader && choice_ppshader->IsEmpty())

View File

@ -128,10 +128,10 @@ void PSTextureEncoder::Encode(u8* dst, const EFBCopyParams& params, u32 native_w
D3D::stateman->SetPixelConstants(m_encodeParams);
// We also linear filtering for both box filtering and downsampling higher resolutions to 1x
// TODO: This only produces perfect downsampling for 1.5x and 2x IR, other resolution will
// need more complex down filtering to average all pixels and produce the correct result.
// TODO: This only produces perfect downsampling for 2x IR, other resolutions will need more
// complex down filtering to average all pixels and produce the correct result.
// Also, box filtering won't be correct for anything other than 1x IR
if (scale_by_half || g_ActiveConfig.iEFBScale != SCALE_1X)
if (scale_by_half || g_ActiveConfig.iEFBScale != 1)
D3D::SetLinearCopySampler();
else
D3D::SetPointCopySampler();

View File

@ -230,10 +230,10 @@ static void EncodeToRamUsingShader(GLuint srcTexture, u8* destAddr, u32 dst_line
glBindTexture(GL_TEXTURE_2D_ARRAY, srcTexture);
// We also linear filtering for both box filtering and downsampling higher resolutions to 1x
// TODO: This only produces perfect downsampling for 1.5x and 2x IR, other resolution will
// need more complex down filtering to average all pixels and produce the correct result.
// TODO: This only produces perfect downsampling for 2x IR, other resolutions will need more
// complex down filtering to average all pixels and produce the correct result.
// Also, box filtering won't be correct for anything other than 1x IR
if (linearFilter || g_ActiveConfig.iEFBScale != SCALE_1X)
if (linearFilter || g_ActiveConfig.iEFBScale != 1)
g_sampler_cache->BindLinearSampler(9);
else
g_sampler_cache->BindNearestSampler(9);

View File

@ -248,9 +248,9 @@ void TextureConverter::EncodeTextureToMemory(VkImageView src_texture, u8* dest_p
draw.SetPushConstants(position_uniform, sizeof(position_uniform));
// We also linear filtering for both box filtering and downsampling higher resolutions to 1x
// TODO: This only produces perfect downsampling for 1.5x and 2x IR, other resolution will
// need more complex down filtering to average all pixels and produce the correct result.
bool linear_filter = (scale_by_half && !params.depth) || g_ActiveConfig.iEFBScale != SCALE_1X;
// TODO: This only produces perfect downsampling for 2x IR, other resolutions will need more
// complex down filtering to average all pixels and produce the correct result.
bool linear_filter = (scale_by_half && !params.depth) || g_ActiveConfig.iEFBScale != 1;
draw.SetPSSampler(0, src_texture, linear_filter ? g_object_cache->GetLinearSampler() :
g_object_cache->GetPointSampler());

View File

@ -80,8 +80,7 @@ static float AspectToWidescreen(float aspect)
}
Renderer::Renderer(int backbuffer_width, int backbuffer_height)
: m_backbuffer_width(backbuffer_width), m_backbuffer_height(backbuffer_height),
m_last_efb_scale(g_ActiveConfig.iEFBScale)
: m_backbuffer_width(backbuffer_width), m_backbuffer_height(backbuffer_height)
{
FramebufferManagerBase::SetLastXfbWidth(MAX_XFB_WIDTH);
FramebufferManagerBase::SetLastXfbHeight(MAX_XFB_HEIGHT);
@ -134,26 +133,12 @@ void Renderer::RenderToXFB(u32 xfbAddr, const EFBRectangle& sourceRc, u32 fbStri
int Renderer::EFBToScaledX(int x) const
{
switch (g_ActiveConfig.iEFBScale)
{
case SCALE_AUTO: // fractional
return FramebufferManagerBase::ScaleToVirtualXfbWidth(x, m_target_rectangle);
default:
return x * (int)m_efb_scale_numeratorX / (int)m_efb_scale_denominatorX;
};
return x * static_cast<int>(m_efb_scale);
}
int Renderer::EFBToScaledY(int y) const
{
switch (g_ActiveConfig.iEFBScale)
{
case SCALE_AUTO: // fractional
return FramebufferManagerBase::ScaleToVirtualXfbHeight(y, m_target_rectangle);
default:
return y * (int)m_efb_scale_numeratorY / (int)m_efb_scale_denominatorY;
};
return y * static_cast<int>(m_efb_scale);
}
float Renderer::EFBToScaledXf(float x) const
@ -168,89 +153,31 @@ float Renderer::EFBToScaledYf(float y) const
std::tuple<int, int> Renderer::CalculateTargetScale(int x, int y) const
{
if (g_ActiveConfig.iEFBScale == SCALE_AUTO || g_ActiveConfig.iEFBScale == SCALE_AUTO_INTEGRAL)
{
return std::make_tuple(x, y);
}
const int scaled_x =
x * static_cast<int>(m_efb_scale_numeratorX) / static_cast<int>(m_efb_scale_denominatorX);
const int scaled_y =
y * static_cast<int>(m_efb_scale_numeratorY) / static_cast<int>(m_efb_scale_denominatorY);
return std::make_tuple(scaled_x, scaled_y);
return std::make_tuple(x * static_cast<int>(m_efb_scale), y * static_cast<int>(m_efb_scale));
}
// return true if target size changed
bool Renderer::CalculateTargetSize()
{
m_last_efb_scale = g_ActiveConfig.iEFBScale;
if (g_ActiveConfig.iEFBScale == EFB_SCALE_AUTO_INTEGRAL)
{
// Set a scale based on the window size
int width = FramebufferManagerBase::ScaleToVirtualXfbWidth(EFB_WIDTH, m_target_rectangle);
int height = FramebufferManagerBase::ScaleToVirtualXfbHeight(EFB_HEIGHT, m_target_rectangle);
m_efb_scale = std::max((width - 1) / EFB_WIDTH + 1, (height - 1) / EFB_HEIGHT + 1);
}
else
{
m_efb_scale = g_ActiveConfig.iEFBScale;
}
const u32 max_size = g_ActiveConfig.backend_info.MaxTextureSize;
if (max_size < EFB_WIDTH * m_efb_scale)
m_efb_scale = max_size / EFB_WIDTH;
int new_efb_width = 0;
int new_efb_height = 0;
// TODO: Ugly. Clean up
switch (m_last_efb_scale)
{
case SCALE_AUTO:
case SCALE_AUTO_INTEGRAL:
new_efb_width = FramebufferManagerBase::ScaleToVirtualXfbWidth(EFB_WIDTH, m_target_rectangle);
new_efb_height =
FramebufferManagerBase::ScaleToVirtualXfbHeight(EFB_HEIGHT, m_target_rectangle);
if (m_last_efb_scale == SCALE_AUTO_INTEGRAL)
{
m_efb_scale_numeratorX = m_efb_scale_numeratorY =
std::max((new_efb_width - 1) / EFB_WIDTH + 1, (new_efb_height - 1) / EFB_HEIGHT + 1);
m_efb_scale_denominatorX = m_efb_scale_denominatorY = 1;
new_efb_width = EFBToScaledX(EFB_WIDTH);
new_efb_height = EFBToScaledY(EFB_HEIGHT);
}
else
{
m_efb_scale_numeratorX = new_efb_width;
m_efb_scale_denominatorX = EFB_WIDTH;
m_efb_scale_numeratorY = new_efb_height;
m_efb_scale_denominatorY = EFB_HEIGHT;
}
break;
case SCALE_1X:
m_efb_scale_numeratorX = m_efb_scale_numeratorY = 1;
m_efb_scale_denominatorX = m_efb_scale_denominatorY = 1;
break;
case SCALE_1_5X:
m_efb_scale_numeratorX = m_efb_scale_numeratorY = 3;
m_efb_scale_denominatorX = m_efb_scale_denominatorY = 2;
break;
case SCALE_2X:
m_efb_scale_numeratorX = m_efb_scale_numeratorY = 2;
m_efb_scale_denominatorX = m_efb_scale_denominatorY = 1;
break;
case SCALE_2_5X:
m_efb_scale_numeratorX = m_efb_scale_numeratorY = 5;
m_efb_scale_denominatorX = m_efb_scale_denominatorY = 2;
break;
default:
m_efb_scale_numeratorX = m_efb_scale_numeratorY = m_last_efb_scale - 3;
m_efb_scale_denominatorX = m_efb_scale_denominatorY = 1;
const u32 max_size = g_ActiveConfig.backend_info.MaxTextureSize;
if (max_size < EFB_WIDTH * m_efb_scale_numeratorX / m_efb_scale_denominatorX)
{
m_efb_scale_numeratorX = m_efb_scale_numeratorY = (max_size / EFB_WIDTH);
m_efb_scale_denominatorX = m_efb_scale_denominatorY = 1;
}
break;
}
if (m_last_efb_scale > SCALE_AUTO_INTEGRAL)
std::tie(new_efb_width, new_efb_height) = CalculateTargetScale(EFB_WIDTH, EFB_HEIGHT);
std::tie(new_efb_width, new_efb_height) = CalculateTargetScale(EFB_WIDTH, EFB_HEIGHT);
if (new_efb_width != m_target_width || new_efb_height != m_target_height)
{
@ -383,26 +310,14 @@ void Renderer::DrawDebugText()
std::string res_text;
switch (g_ActiveConfig.iEFBScale)
{
case SCALE_AUTO:
res_text = "Auto (fractional)";
break;
case SCALE_AUTO_INTEGRAL:
case EFB_SCALE_AUTO_INTEGRAL:
res_text = "Auto (integral)";
break;
case SCALE_1X:
case 1:
res_text = "Native";
break;
case SCALE_1_5X:
res_text = "1.5x";
break;
case SCALE_2X:
res_text = "2x";
break;
case SCALE_2_5X:
res_text = "2.5x";
break;
default:
res_text = StringFromFormat("%dx", g_ActiveConfig.iEFBScale - 3);
res_text = StringFromFormat("%dx", g_ActiveConfig.iEFBScale);
break;
}
const char* ar_text = "";
@ -648,7 +563,8 @@ void Renderer::SetWindowSize(int width, int height)
height = std::max(height, 1);
// Scale the window size by the EFB scale.
std::tie(width, height) = CalculateTargetScale(width, height);
if (g_ActiveConfig.iEFBScale != EFB_SCALE_AUTO_INTEGRAL)
std::tie(width, height) = CalculateTargetScale(width, height);
float scaled_width, scaled_height;
std::tie(scaled_width, scaled_height) = ScaleToDisplayAspectRatio(width, height);

View File

@ -78,8 +78,7 @@ public:
virtual void RestoreState() {}
virtual void ResetAPIState() {}
virtual void RestoreAPIState() {}
// Ideal internal resolution - determined by display resolution (automatic scaling) and/or a
// multiple of the native EFB resolution
// Ideal internal resolution - multiple of the native EFB resolution
int GetTargetWidth() const { return m_target_width; }
int GetTargetHeight() const { return m_target_height; }
// Display resolution
@ -170,7 +169,6 @@ protected:
// TODO: Add functionality to reinit all the render targets when the window is resized.
int m_backbuffer_width = 0;
int m_backbuffer_height = 0;
int m_last_efb_scale = 0;
TargetRectangle m_target_rectangle = {};
bool m_xfb_written = false;
@ -191,10 +189,7 @@ private:
void ShutdownFrameDumping();
PEControl::PixelFormat m_prev_efb_format = PEControl::INVALID_FMT;
unsigned int m_efb_scale_numeratorX = 1;
unsigned int m_efb_scale_numeratorY = 1;
unsigned int m_efb_scale_denominatorX = 1;
unsigned int m_efb_scale_denominatorY = 1;
unsigned int m_efb_scale = 1;
// These will be set on the first call to SetWindowSize.
int m_last_window_request_width = 0;

View File

@ -376,8 +376,7 @@ void VertexShaderManager::SetConstants()
// NOTE: If we ever emulate antialiasing, the sample locations set by
// BP registers 0x01-0x04 need to be considered here.
const float pixel_center_correction = 7.0f / 12.0f - 0.5f;
const bool bUseVertexRounding =
g_ActiveConfig.bVertexRounding && g_ActiveConfig.iEFBScale != SCALE_1X;
const bool bUseVertexRounding = g_ActiveConfig.bVertexRounding && g_ActiveConfig.iEFBScale != 1;
const float viewport_width = bUseVertexRounding ?
(2.f * xfmem.viewport.wd) :
g_renderer->EFBToScaledXf(2.f * xfmem.viewport.wd);

View File

@ -139,26 +139,6 @@ void VideoConfig::Refresh()
phack.m_zfar = Config::Get(Config::GFX_PROJECTION_HACK_ZFAR);
bPerfQueriesEnable = Config::Get(Config::GFX_PERF_QUERIES_ENABLE);
if (iEFBScale == SCALE_FORCE_INTEGRAL)
{
// Round down to multiple of native IR
switch (Config::GetBase(Config::GFX_EFB_SCALE))
{
case SCALE_AUTO:
iEFBScale = SCALE_AUTO_INTEGRAL;
break;
case SCALE_1_5X:
iEFBScale = SCALE_1X;
break;
case SCALE_2_5X:
iEFBScale = SCALE_2X;
break;
default:
iEFBScale = Config::GetBase(Config::GFX_EFB_SCALE);
break;
}
}
VerifyValidity();
}

View File

@ -22,6 +22,8 @@
#define CONF_SAVETARGETS 8
#define CONF_SAVESHADERS 16
constexpr int EFB_SCALE_AUTO_INTEGRAL = 0;
enum AspectMode
{
ASPECT_AUTO = 0,
@ -30,17 +32,6 @@ enum AspectMode
ASPECT_STRETCH = 3,
};
enum EFBScale
{
SCALE_FORCE_INTEGRAL = -1,
SCALE_AUTO,
SCALE_AUTO_INTEGRAL,
SCALE_1X,
SCALE_1_5X,
SCALE_2X,
SCALE_2_5X,
};
enum StereoMode
{
STEREO_OFF = 0,
@ -252,7 +243,7 @@ struct VideoConfig final
{
return backend_info.bSupportsGPUTextureDecoding && bEnableGPUTextureDecoding;
}
bool UseVertexRounding() const { return bVertexRounding && iEFBScale != SCALE_1X; }
bool UseVertexRounding() const { return bVertexRounding && iEFBScale != 1; }
u32 GetShaderCompilerThreads() const;
u32 GetShaderPrecompilerThreads() const;
bool CanPrecompileUberShaders() const;