mirror of https://github.com/PCSX2/pcsx2.git
Merge pull request #356 from PCSX2/issue-fixes
various bug-tracker fixes
This commit is contained in:
commit
070dce4c83
|
@ -515,13 +515,12 @@ float4 FxaaPixelShader(float2 pos, FxaaTex tex, float2 fxaaRcpFrame, float fxaaS
|
||||||
|
|
||||||
float4 FxaaPass(float4 FxaaColor, float2 texcoord)
|
float4 FxaaPass(float4 FxaaColor, float2 texcoord)
|
||||||
{
|
{
|
||||||
FxaaTex tex;
|
|
||||||
|
|
||||||
#if(GLSL == 1)
|
#if(GLSL == 1)
|
||||||
tex = TextureSampler;
|
tex = TextureSampler;
|
||||||
vec2 PixelSize = textureSize(tex, 0);
|
FxaaColor = FxaaPixelShader(texcoord, TextureSampler, pixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);
|
||||||
FxaaColor = FxaaPixelShader(texcoord, tex, 1.0/PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);
|
|
||||||
#else
|
#else
|
||||||
|
FxaaTex tex;
|
||||||
|
|
||||||
tex.tex = Texture;
|
tex.tex = Texture;
|
||||||
tex.smpl = TextureSampler;
|
tex.smpl = TextureSampler;
|
||||||
FxaaColor = FxaaPixelShader(texcoord, tex, pixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);
|
FxaaColor = FxaaPixelShader(texcoord, tex, pixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
/* PCSX2 - PS2 Emulator for PCs
|
||||||
|
* Copyright (C) 2002-2014 PCSX2 Dev Team
|
||||||
|
*
|
||||||
|
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
||||||
|
* of the GNU Lesser General Public License as published by the Free Software Found-
|
||||||
|
* ation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE. See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with PCSX2.
|
||||||
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <wx/apptrait.h>
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
// Pcsx2AppTraits
|
||||||
|
// --------------------------------------------------------------------------------------
|
||||||
|
// Overrides and customizes some default wxWidgets behaviors. This class is instanized by
|
||||||
|
// calls to Pcsx2App::CreateTraits(), which is called from wxWidgets as-needed. wxWidgets
|
||||||
|
// does cache an instance of the traits, so the object construction need not be trivial
|
||||||
|
// (translation: it can be complicated-ish -- it won't affect performance).
|
||||||
|
//
|
||||||
|
class Pcsx2AppTraits : public wxGUIAppTraits
|
||||||
|
{
|
||||||
|
typedef wxGUIAppTraits _parent;
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual ~Pcsx2AppTraits() {}
|
||||||
|
wxMessageOutput* CreateMessageOutput();
|
||||||
|
|
||||||
|
#ifdef wxUSE_STDPATHS
|
||||||
|
#if wxMAJOR_VERSION < 3
|
||||||
|
wxStandardPathsBase& GetStandardPaths();
|
||||||
|
#else
|
||||||
|
wxStandardPaths& GetStandardPaths();
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "Threading.h"
|
#include "Threading.h"
|
||||||
#include "wxGuiTools.h"
|
#include "wxGuiTools.h"
|
||||||
#include "pxEvents.h"
|
#include "pxEvents.h"
|
||||||
|
#include "AppTrait.h"
|
||||||
|
|
||||||
using namespace Threading;
|
using namespace Threading;
|
||||||
|
|
||||||
|
@ -81,6 +82,8 @@ public:
|
||||||
wxAppWithHelpers();
|
wxAppWithHelpers();
|
||||||
virtual ~wxAppWithHelpers() {}
|
virtual ~wxAppWithHelpers() {}
|
||||||
|
|
||||||
|
wxAppTraits* CreateTraits();
|
||||||
|
|
||||||
void CleanUp();
|
void CleanUp();
|
||||||
|
|
||||||
void DeleteObject( BaseDeletableObject& obj );
|
void DeleteObject( BaseDeletableObject& obj );
|
||||||
|
|
|
@ -664,6 +664,18 @@ void wxAppWithHelpers::OnDeleteObject( wxCommandEvent& evt )
|
||||||
delete (BaseDeletableObject*)evt.GetClientData();
|
delete (BaseDeletableObject*)evt.GetClientData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In theory we create a Pcsx2App object which inherit from wxAppWithHelpers,
|
||||||
|
// so Pcsx2App::CreateTraits must be used instead.
|
||||||
|
//
|
||||||
|
// However it doesn't work this way because wxAppWithHelpers constructor will
|
||||||
|
// be called first. This constructor will build some wx objects (here wxTimer)
|
||||||
|
// that require a trait. In others word, wxAppWithHelpers::CreateTraits will be
|
||||||
|
// called instead
|
||||||
|
wxAppTraits* wxAppWithHelpers::CreateTraits()
|
||||||
|
{
|
||||||
|
return new Pcsx2AppTraits;
|
||||||
|
}
|
||||||
|
|
||||||
// Threads have their own deletion handler that propagates exceptions thrown by the thread to the UI.
|
// Threads have their own deletion handler that propagates exceptions thrown by the thread to the UI.
|
||||||
// (thus we have a fairly automatic threaded exception system!)
|
// (thus we have a fairly automatic threaded exception system!)
|
||||||
void wxAppWithHelpers::OnDeleteThread( wxCommandEvent& evt )
|
void wxAppWithHelpers::OnDeleteThread( wxCommandEvent& evt )
|
||||||
|
|
|
@ -362,31 +362,6 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------
|
|
||||||
// Pcsx2AppTraits
|
|
||||||
// --------------------------------------------------------------------------------------
|
|
||||||
// Overrides and customizes some default wxWidgets behaviors. This class is instanized by
|
|
||||||
// calls to Pcsx2App::CreateTraits(), which is called from wxWidgets as-needed. wxWidgets
|
|
||||||
// does cache an instance of the traits, so the object construction need not be trivial
|
|
||||||
// (translation: it can be complicated-ish -- it won't affect performance).
|
|
||||||
//
|
|
||||||
class Pcsx2AppTraits : public wxGUIAppTraits
|
|
||||||
{
|
|
||||||
typedef wxGUIAppTraits _parent;
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual ~Pcsx2AppTraits() {}
|
|
||||||
wxMessageOutput* CreateMessageOutput();
|
|
||||||
|
|
||||||
#ifdef wxUSE_STDPATHS
|
|
||||||
#if wxMAJOR_VERSION < 3
|
|
||||||
wxStandardPathsBase& GetStandardPaths();
|
|
||||||
#else
|
|
||||||
wxStandardPaths& GetStandardPaths();
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
// =====================================================================================================
|
// =====================================================================================================
|
||||||
// Pcsx2App - main wxApp class
|
// Pcsx2App - main wxApp class
|
||||||
// =====================================================================================================
|
// =====================================================================================================
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "Debugger/DisassemblyDialog.h"
|
#include "Debugger/DisassemblyDialog.h"
|
||||||
|
|
||||||
#include "Utilities/IniInterface.h"
|
#include "Utilities/IniInterface.h"
|
||||||
|
#include "Utilities/AppTrait.h"
|
||||||
|
|
||||||
#include <wx/stdpaths.h>
|
#include <wx/stdpaths.h>
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,10 @@ bool GSWndWGL::CreateContext(int major, int minor)
|
||||||
// FIXME : Request a debug context to ease opengl development
|
// FIXME : Request a debug context to ease opengl development
|
||||||
// Note: don't support deprecated feature (pre openg 3.1)
|
// Note: don't support deprecated feature (pre openg 3.1)
|
||||||
//GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
|
//GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
|
||||||
|
#ifdef ENABLE_OGL_DEBUG
|
||||||
WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_DEBUG_BIT_ARB,
|
WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_DEBUG_BIT_ARB,
|
||||||
|
#endif
|
||||||
|
WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -527,9 +527,9 @@ float4 FxaaPass(float4 FxaaColor, float2 uv0)
|
||||||
float4 FxaaPass(float4 FxaaColor : COLOR0, float2 uv0 : TEXCOORD0)
|
float4 FxaaPass(float4 FxaaColor : COLOR0, float2 uv0 : TEXCOORD0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
FxaaTex tex;
|
|
||||||
|
|
||||||
#if (SHADER_MODEL >= 0x400)
|
#if (SHADER_MODEL >= 0x400)
|
||||||
|
FxaaTex tex;
|
||||||
tex.tex = Texture;
|
tex.tex = Texture;
|
||||||
tex.smpl = TextureSampler;
|
tex.smpl = TextureSampler;
|
||||||
|
|
||||||
|
@ -538,12 +538,11 @@ float4 FxaaPass(float4 FxaaColor : COLOR0, float2 uv0 : TEXCOORD0)
|
||||||
|
|
||||||
#elif (FXAA_GLSL_130 == 1)
|
#elif (FXAA_GLSL_130 == 1)
|
||||||
|
|
||||||
tex = TextureSampler;
|
vec2 PixelSize = textureSize(TextureSampler, 0);
|
||||||
vec2 PixelSize = textureSize(tex, 0);
|
FxaaColor = FxaaPixelShader(uv0, TextureSampler, 1.0/PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);
|
||||||
FxaaColor = FxaaPixelShader(uv0, tex, 1.0/PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
FxaaTex tex;
|
||||||
tex = TextureSampler;
|
tex = TextureSampler;
|
||||||
FxaaColor = FxaaPixelShader(uv0, tex, PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);
|
FxaaColor = FxaaPixelShader(uv0, tex, PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2053,9 +2053,9 @@ static const char* fxaa_fx =
|
||||||
"float4 FxaaPass(float4 FxaaColor : COLOR0, float2 uv0 : TEXCOORD0)\n"
|
"float4 FxaaPass(float4 FxaaColor : COLOR0, float2 uv0 : TEXCOORD0)\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" FxaaTex tex;\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
" #if (SHADER_MODEL >= 0x400)\n"
|
" #if (SHADER_MODEL >= 0x400)\n"
|
||||||
|
" FxaaTex tex;\n"
|
||||||
" tex.tex = Texture;\n"
|
" tex.tex = Texture;\n"
|
||||||
" tex.smpl = TextureSampler;\n"
|
" tex.smpl = TextureSampler;\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -2064,12 +2064,11 @@ static const char* fxaa_fx =
|
||||||
"\n"
|
"\n"
|
||||||
" #elif (FXAA_GLSL_130 == 1)\n"
|
" #elif (FXAA_GLSL_130 == 1)\n"
|
||||||
"\n"
|
"\n"
|
||||||
" tex = TextureSampler;\n"
|
" vec2 PixelSize = textureSize(TextureSampler, 0);\n"
|
||||||
" vec2 PixelSize = textureSize(tex, 0);\n"
|
" FxaaColor = FxaaPixelShader(uv0, TextureSampler, 1.0/PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);\n"
|
||||||
" FxaaColor = FxaaPixelShader(uv0, tex, 1.0/PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
" #else\n"
|
" #else\n"
|
||||||
"\n"
|
" FxaaTex tex;\n"
|
||||||
" tex = TextureSampler;\n"
|
" tex = TextureSampler;\n"
|
||||||
" FxaaColor = FxaaPixelShader(uv0, tex, PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);\n"
|
" FxaaColor = FxaaPixelShader(uv0, tex, PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);\n"
|
||||||
" #endif\n"
|
" #endif\n"
|
||||||
|
|
Loading…
Reference in New Issue