Skip to content

Commit

Permalink
gsdx-d3d11: Add CopyRenderTarget function
Browse files Browse the repository at this point in the history
  • Loading branch information
tadanokojin authored and lightningterror committed Dec 17, 2018
1 parent 1427d55 commit 84dbdd6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions plugins/GSdx/Renderers/DX11/GSDevice11.cpp
Expand Up @@ -676,6 +676,18 @@ void GSDevice11::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r)
m_ctx->CopySubresourceRegion(*(GSTexture11*)dTex, 0, 0, 0, 0, *(GSTexture11*)sTex, 0, &box);
}

GSTexture* GSDevice11::CopyRenderTarget(GSTexture* src)
{
int w = src->GetWidth();
int h = src->GetHeight();

GSTexture* dest = CreateRenderTarget(w, h, false);

CopyRect(src, dest, GSVector4i(0, 0, w, h));

return dest;
}

void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, int shader, bool linear)
{
StretchRect(sTex, sRect, dTex, dRect, m_convert.ps[shader], NULL, linear);
Expand Down
2 changes: 2 additions & 0 deletions plugins/GSdx/Renderers/DX11/GSDevice11.h
Expand Up @@ -192,6 +192,8 @@ class GSDevice11 : public GSDeviceDX

GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0, int ps_shader = 0);

GSTexture* CopyRenderTarget(GSTexture* src);

void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r);

void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, int shader = 0, bool linear = true);
Expand Down

0 comments on commit 84dbdd6

Please sign in to comment.