diff --git a/Source/Plugins/Plugin_VideoDX9/Src/FramebufferManager.cpp b/Source/Plugins/Plugin_VideoDX9/Src/FramebufferManager.cpp index aa53e58dc4..dbc8c659b1 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/FramebufferManager.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/FramebufferManager.cpp @@ -22,6 +22,7 @@ namespace FBManager { +static LPDIRECT3DTEXTURE9 s_efb_color_texture; static LPDIRECT3DSURFACE9 s_efb_color_surface; static LPDIRECT3DSURFACE9 s_efb_depth_surface; @@ -31,14 +32,24 @@ static LPDIRECT3DSURFACE9 s_efb_depth_surface; LPDIRECT3DSURFACE9 GetEFBColorRTSurface() { return s_efb_color_surface; } LPDIRECT3DSURFACE9 GetEFBDepthRTSurface() { return s_efb_depth_surface; } +LPDIRECT3DTEXTURE9 GetEFBColorTexture(const EFBRectangle& sourceRc) +{ + return s_efb_color_texture; +} + void Create() { // Simplest possible setup to start with. int target_width = Renderer::GetTargetWidth(); int target_height = Renderer::GetTargetHeight(); - HRESULT hr = D3D::dev->CreateRenderTarget(target_width, target_height, D3DFMT_A8R8G8B8, - D3DMULTISAMPLE_NONE, 0, FALSE, &s_efb_color_surface, NULL); + + HRESULT hr = D3D::dev->CreateTexture(target_width, target_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, + D3DPOOL_DEFAULT, &s_efb_color_texture, NULL); CHECK(hr); + + hr = s_efb_color_texture->GetSurfaceLevel(0, &s_efb_color_surface); + CHECK(hr); + hr = D3D::dev->CreateDepthStencilSurface(target_width, target_height, D3DFMT_D24S8, D3DMULTISAMPLE_NONE, 0, FALSE, &s_efb_depth_surface, NULL); CHECK(hr); @@ -48,8 +59,13 @@ void Destroy() { s_efb_depth_surface->Release(); s_efb_depth_surface = NULL; + s_efb_color_surface->Release(); s_efb_color_surface = NULL; +#ifdef TEXSURF + s_efb_color_texture->Release(); + s_efb_color_texture = NULL; +#endif } } // namespace \ No newline at end of file