mirror of https://github.com/PCSX2/pcsx2.git
GSDX: Modified the FXAA shader loading so Page Up works again. Now loads the shader just in time.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5801 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
b13c00f42d
commit
5aa0a9a94d
|
@ -32,7 +32,8 @@ GSDevice11::GSDevice11()
|
|||
memset(&m_ps_cb_cache, 0, sizeof(m_ps_cb_cache));
|
||||
|
||||
UserHacks_NVIDIAHack = !!theApp.GetConfig("UserHacks_NVIDIAHack", 0) && !!theApp.GetConfig("UserHacks", 0);
|
||||
Use_FXAA_Shader = !!theApp.GetConfig("Fxaa", 0);
|
||||
FFXA_Compiled = false;
|
||||
|
||||
m_state.topology = D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED;
|
||||
m_state.bf = -1;
|
||||
}
|
||||
|
@ -273,6 +274,8 @@ bool GSDevice11::Create(GSWnd* wnd)
|
|||
|
||||
hr = m_dev->CreateBuffer(&bd, NULL, &m_fxaa.cb);
|
||||
|
||||
FFXA_Compiled = false;
|
||||
/*
|
||||
if (Use_FXAA_Shader)
|
||||
{
|
||||
#if EXTERNAL_SHADER_LOADING
|
||||
|
@ -286,7 +289,8 @@ bool GSDevice11::Create(GSWnd* wnd)
|
|||
// internal shader
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
#endif
|
||||
}
|
||||
FFXA_Compiled = true;
|
||||
}*/
|
||||
//
|
||||
|
||||
memset(&rd, 0, sizeof(rd));
|
||||
|
@ -745,6 +749,20 @@ void GSDevice11::DoFXAA(GSTexture* st, GSTexture* dt)
|
|||
|
||||
FXAAConstantBuffer cb;
|
||||
|
||||
if (!FFXA_Compiled)
|
||||
{
|
||||
#if EXTERNAL_SHADER_LOADING
|
||||
try {
|
||||
CompileShader("shader.fx", "ps_main", NULL, &m_fxaa.ps);
|
||||
}
|
||||
catch (GSDXRecoverableError) {
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
}
|
||||
#else
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
#endif
|
||||
FFXA_Compiled = true;
|
||||
}
|
||||
cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f);
|
||||
cb.rcpFrameOpt = GSVector4::zero();
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ public: // TODO
|
|||
CComPtr<ID3D11RasterizerState> m_rs;
|
||||
|
||||
bool UserHacks_NVIDIAHack;
|
||||
bool Use_FXAA_Shader;
|
||||
bool FFXA_Compiled;
|
||||
|
||||
struct
|
||||
{
|
||||
|
|
|
@ -28,8 +28,7 @@ GSDevice9::GSDevice9()
|
|||
: m_lost(false)
|
||||
{
|
||||
m_rbswapped = true;
|
||||
|
||||
Use_FXAA_Shader = !!theApp.GetConfig("Fxaa", 0);
|
||||
FFXA_Compiled = false;
|
||||
|
||||
memset(&m_pp, 0, sizeof(m_pp));
|
||||
memset(&m_d3dcaps, 0, sizeof(m_d3dcaps));
|
||||
|
@ -360,6 +359,8 @@ bool GSDevice9::Create(GSWnd* wnd)
|
|||
|
||||
CompileShader(IDR_SHADEBOOST_FX, "ps_main", macro, &m_shadeboost.ps);
|
||||
|
||||
FFXA_Compiled = false;
|
||||
/*
|
||||
// fxaa
|
||||
if (Use_FXAA_Shader)
|
||||
{
|
||||
|
@ -373,7 +374,7 @@ bool GSDevice9::Create(GSWnd* wnd)
|
|||
#else
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
#endif
|
||||
}
|
||||
}*/
|
||||
// create shader layout
|
||||
|
||||
VSSelector sel;
|
||||
|
@ -942,6 +943,21 @@ void GSDevice9::DoFXAA(GSTexture* st, GSTexture* dt)
|
|||
|
||||
FXAAConstantBuffer cb;
|
||||
|
||||
if (!FFXA_Compiled)
|
||||
{
|
||||
#if EXTERNAL_SHADER_LOADING
|
||||
try {
|
||||
CompileShader("shader.fx", "ps_main", NULL, &m_fxaa.ps);
|
||||
}
|
||||
catch (GSDXRecoverableError) {
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
}
|
||||
#else
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
#endif
|
||||
FFXA_Compiled = true;
|
||||
}
|
||||
|
||||
cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f);
|
||||
cb.rcpFrameOpt = GSVector4::zero();
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ class GSDevice9 : public GSDeviceDX
|
|||
|
||||
public: // TODO
|
||||
|
||||
bool Use_FXAA_Shader;
|
||||
bool FFXA_Compiled;
|
||||
|
||||
struct
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue