gsdx: new linux option linear_present

Purpose is to control the filtering when final image is displayed on the screen

Could improve the sharpness of the output in some games (ofc, it will be pixelated)
This commit is contained in:
Gregory Hainaut 2016-08-27 19:23:12 +02:00
parent d78d515acb
commit 7103707aeb
6 changed files with 14 additions and 1 deletions

View File

@ -40,6 +40,7 @@ GSDevice::GSDevice()
{
memset(&m_vertex, 0, sizeof(m_vertex));
memset(&m_index, 0, sizeof(m_index));
m_linear_present = theApp.GetConfigB("linear_present");
}
GSDevice::~GSDevice()
@ -109,6 +110,7 @@ void GSDevice::Present(const GSVector4i& r, int shader)
GL_PUSH("Present");
// FIXME is it mandatory, it could be slow
ClearRenderTarget(m_backbuffer, 0);
if(m_current)
@ -125,7 +127,7 @@ void GSDevice::Present(const GSVector4i& r, int shader)
void GSDevice::Present(GSTexture* sTex, GSTexture* dTex, const GSVector4& dRect, int shader)
{
StretchRect(sTex, dTex, dRect, shader);
StretchRect(sTex, dTex, dRect, shader, m_linear_present);
}
GSTexture* GSDevice::FetchSurface(int type, int w, int h, bool msaa, int format)

View File

@ -117,6 +117,7 @@ protected:
struct {size_t stride, start, count, limit;} m_vertex;
struct {size_t start, count, limit;} m_index;
unsigned int m_frame; // for ageing the pool
bool m_linear_present;
virtual GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format) = 0;
virtual GSTexture* FetchSurface(int type, int w, int h, bool msaa, int format);

View File

@ -312,6 +312,8 @@ void populate_shader_table(GtkWidget* shader_table)
GtkWidget* tv_shader_label = left_label("TV shader:");
GtkWidget* tv_shader = CreateComboBoxFromVector(theApp.m_gs_tv_shaders, "TVShader");
GtkWidget* linear_check = CreateCheckBox("Texture Filtering of Display", "linear_present");
// Shadeboost scale
GtkWidget* sb_brightness = CreateScale("ShadeBoost_Brightness");
GtkWidget* sb_brightness_label = left_label("Shade Boost Brightness:");
@ -325,8 +327,10 @@ void populate_shader_table(GtkWidget* shader_table)
AddTooltip(shadeboost_check, IDC_SHADEBOOST);
AddTooltip(shaderfx_check, IDC_SHADER_FX);
AddTooltip(fxaa_check, IDC_FXAA);
AddTooltip(linear_check, IDC_LINEAR_PRESENT);
s_table_line = 0;
InsertWidgetInTable(shader_table , linear_check);
InsertWidgetInTable(shader_table , fxaa_check);
InsertWidgetInTable(shader_table , shadeboost_check);
InsertWidgetInTable(shader_table , sb_brightness_label , sb_brightness);

View File

@ -127,6 +127,10 @@ const char* dialog_message(int ID, bool* updateText) {
return "Makes textures partially or fully transparent as required by emulation. May cause unusual slowdowns for some games.";
case IDC_LOGZ:
return "Treat depth as logarithmic instead of linear. Recommended setting is on unless it causes graphical glitches.";
#endif
#ifdef __linux__
case IDC_LINEAR_PRESENT:
return "Use bilinear filtering when Upscaling/Downscaling the image to the screen. Disable it if you want a sharper/pixelated output.";
#endif
// Exclusive for Hardware Renderer
case IDC_PRELOAD_GS:

View File

@ -75,5 +75,6 @@ enum {
IDC_PRELOAD_GS,
IDC_FAST_TC_INV,
IDC_LARGE_FB,
IDC_LINEAR_PRESENT,
};
#endif

View File

@ -296,6 +296,7 @@ void GSdxApp::Init()
m_default_configuration["fxaa"] = "0";
m_default_configuration["interlace"] = "7";
m_default_configuration["large_framebuffer"] = "1";
m_default_configuration["linear_present"] = "1";
m_default_configuration["MaxAnisotropy"] = "0";
m_default_configuration["mipmap"] = "1";
m_default_configuration["ModeHeight"] = "480";