diff --git a/plugins/GSdx/Renderers/DX11/GSDevice11.cpp b/plugins/GSdx/Renderers/DX11/GSDevice11.cpp index 63dd194134..643cb4409a 100644 --- a/plugins/GSdx/Renderers/DX11/GSDevice11.cpp +++ b/plugins/GSdx/Renderers/DX11/GSDevice11.cpp @@ -1216,8 +1216,6 @@ void GSDevice11::PSSetShaderResourceView(int i, ID3D11ShaderResourceView* srv, G { m_state.ps_sr_views[i] = srv; m_state.ps_sr_texture[i] = (GSTexture11*)sr; - - m_srv_changed = true; } } @@ -1228,8 +1226,6 @@ void GSDevice11::PSSetSamplerState(ID3D11SamplerState* ss0, ID3D11SamplerState* m_state.ps_ss[0] = ss0; m_state.ps_ss[1] = ss1; m_state.ps_ss[2] = ss2; - - m_ss_changed = true; } } @@ -1242,26 +1238,20 @@ void GSDevice11::PSSetShader(ID3D11PixelShader* ps, ID3D11Buffer* ps_cb) m_ctx->PSSetShader(ps, NULL, 0); } - if(m_srv_changed) - { - m_ctx->PSSetShaderResources(0, m_state.ps_sr_views.size(), m_state.ps_sr_views.data()); - - m_srv_changed = false; - } - - if(m_ss_changed) - { - m_ctx->PSSetSamplers(0, countof(m_state.ps_ss), m_state.ps_ss); - - m_ss_changed = false; - } - if(m_state.ps_cb != ps_cb) { m_state.ps_cb = ps_cb; m_ctx->PSSetConstantBuffers(0, 1, &ps_cb); } + + PSUpdateShaderState(); +} + +void GSDevice11::PSUpdateShaderState() +{ + m_ctx->PSSetShaderResources(0, m_state.ps_sr_views.size(), m_state.ps_sr_views.data()); + m_ctx->PSSetSamplers(0, countof(m_state.ps_ss), m_state.ps_ss); } void GSDevice11::OMSetDepthStencilState(ID3D11DepthStencilState* dss, uint8 sref) diff --git a/plugins/GSdx/Renderers/DX11/GSDevice11.h b/plugins/GSdx/Renderers/DX11/GSDevice11.h index 9a4dfe911f..139aa79a77 100644 --- a/plugins/GSdx/Renderers/DX11/GSDevice11.h +++ b/plugins/GSdx/Renderers/DX11/GSDevice11.h @@ -53,7 +53,6 @@ class GSDevice11 : public GSDeviceDX CComPtr m_ib; CComPtr m_ib_old; - bool m_srv_changed, m_ss_changed; float m_hack_topleft_offset; int m_mipmap; @@ -214,6 +213,7 @@ public: void PSSetShaderResource(int i, GSTexture* sr); void PSSetShaderResourceView(int i, ID3D11ShaderResourceView* srv, GSTexture* sr); void PSSetShader(ID3D11PixelShader* ps, ID3D11Buffer* ps_cb); + void PSUpdateShaderState(); void PSSetSamplerState(ID3D11SamplerState* ss0, ID3D11SamplerState* ss1, ID3D11SamplerState* ss2 = NULL); void OMSetDepthStencilState(ID3D11DepthStencilState* dss, uint8 sref); void OMSetBlendState(ID3D11BlendState* bs, float bf);