diff --git a/plugins/GSdx/GS.h b/plugins/GSdx/GS.h index 388af54658..f670531aa4 100644 --- a/plugins/GSdx/GS.h +++ b/plugins/GSdx/GS.h @@ -26,7 +26,7 @@ #pragma once -#define PLUGIN_VERSION 14 +#define PLUGIN_VERSION 15 #include "GSVector.h" diff --git a/plugins/GSdx/GSRendererHW.h b/plugins/GSdx/GSRendererHW.h index 2ad320f9e8..e343852712 100644 --- a/plugins/GSdx/GSRendererHW.h +++ b/plugins/GSdx/GSRendererHW.h @@ -349,8 +349,6 @@ protected: OverrideOutput(); - m_tc->InvalidateTextures(context->FRAME, context->ZBUF); - if(s_dump) { CString str; @@ -360,6 +358,8 @@ protected: if(s_savez) ds->m_texture.Save(str); // if(s_savez) m_dev.SaveToFileD32S8X24(ds->m_texture, str); // TODO } + + m_tc->InvalidateTextures(context->FRAME, context->ZBUF); } virtual void Draw(int prim, Texture& rt, Texture& ds, typename GSTextureCache::GSTexture* tex) = 0; diff --git a/plugins/GSdx/GSTexture9.cpp b/plugins/GSdx/GSTexture9.cpp index 8d75cc2845..bff9df141c 100644 --- a/plugins/GSdx/GSTexture9.cpp +++ b/plugins/GSdx/GSTexture9.cpp @@ -140,8 +140,8 @@ void GSTexture9::Unmap() bool GSTexture9::Save(CString fn, bool dds) { - CComPtr res; - + CComPtr surface; + if(m_desc.Usage & D3DUSAGE_DEPTHSTENCIL) { HRESULT hr; @@ -153,8 +153,6 @@ bool GSTexture9::Save(CString fn, bool dds) if(desc.Format != D3DFMT_D32F_LOCKABLE) return false; - CComPtr surface; - hr = m_dev->CreateOffscreenPlainSurface(desc.Width, desc.Height, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &surface, NULL); D3DLOCKED_RECT slr, dlr; @@ -175,24 +173,22 @@ bool GSTexture9::Save(CString fn, bool dds) m_surface->UnlockRect(); surface->UnlockRect(); - - res = surface; } else { - res = m_surface; + surface = m_surface; } - if(CComQIPtr surface = res) + if(surface != NULL) { return SUCCEEDED(D3DXSaveSurfaceToFile(fn, dds ? D3DXIFF_DDS : D3DXIFF_BMP, surface, NULL, NULL)); } - - if(CComQIPtr texture = res) +/* + if(CComQIPtr texture = surface) { return SUCCEEDED(D3DXSaveTextureToFile(fn, dds ? D3DXIFF_DDS : D3DXIFF_BMP, texture, NULL)); } - +*/ return false; }