mirror of https://github.com/PCSX2/pcsx2.git
GSDX: New shader is quite slow to compile, so lets not compile it unless the user is using it :)
-switching between sw/hw modes, resuming emulation speed back to normal. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5799 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
a1e387e23e
commit
5e22971db0
|
@ -32,7 +32,7 @@ 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);
|
||||
m_state.topology = D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED;
|
||||
m_state.bf = -1;
|
||||
}
|
||||
|
@ -273,17 +273,20 @@ bool GSDevice11::Create(GSWnd* wnd)
|
|||
|
||||
hr = m_dev->CreateBuffer(&bd, NULL, &m_fxaa.cb);
|
||||
|
||||
if (Use_FXAA_Shader)
|
||||
{
|
||||
#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);
|
||||
}
|
||||
try {
|
||||
CompileShader("shader.fx", "ps_main", NULL, &m_fxaa.ps);
|
||||
}
|
||||
catch (GSDXRecoverableError) {
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
}
|
||||
#else
|
||||
// internal shader
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
// internal shader
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
#endif
|
||||
}
|
||||
//
|
||||
|
||||
memset(&rd, 0, sizeof(rd));
|
||||
|
|
|
@ -82,6 +82,7 @@ public: // TODO
|
|||
CComPtr<ID3D11RasterizerState> m_rs;
|
||||
|
||||
bool UserHacks_NVIDIAHack;
|
||||
bool Use_FXAA_Shader;
|
||||
|
||||
struct
|
||||
{
|
||||
|
|
|
@ -29,6 +29,8 @@ GSDevice9::GSDevice9()
|
|||
{
|
||||
m_rbswapped = true;
|
||||
|
||||
Use_FXAA_Shader = !!theApp.GetConfig("Fxaa", 0);
|
||||
|
||||
memset(&m_pp, 0, sizeof(m_pp));
|
||||
memset(&m_d3dcaps, 0, sizeof(m_d3dcaps));
|
||||
memset(&m_state, 0, sizeof(m_state));
|
||||
|
@ -359,16 +361,19 @@ bool GSDevice9::Create(GSWnd* wnd)
|
|||
CompileShader(IDR_SHADEBOOST_FX, "ps_main", macro, &m_shadeboost.ps);
|
||||
|
||||
// fxaa
|
||||
if (Use_FXAA_Shader)
|
||||
{
|
||||
#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);
|
||||
}
|
||||
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);
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
#endif
|
||||
}
|
||||
// create shader layout
|
||||
|
||||
VSSelector sel;
|
||||
|
|
|
@ -113,6 +113,8 @@ class GSDevice9 : public GSDeviceDX
|
|||
|
||||
public: // TODO
|
||||
|
||||
bool Use_FXAA_Shader;
|
||||
|
||||
struct
|
||||
{
|
||||
CComPtr<IDirect3DVertexDeclaration9> il;
|
||||
|
|
Loading…
Reference in New Issue