gsdx-d3d11: Add rgba channel selection/support to StretchRect.

This commit is contained in:
lightningterror 2019-06-19 16:47:57 +02:00
parent e9825dccc0
commit 40929a4728
2 changed files with 21 additions and 1 deletions

View File

@ -783,7 +783,26 @@ void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture*
StretchRect(sTex, sRect, dTex, dRect, ps, ps_cb, m_convert.bs, linear); StretchRect(sTex, sRect, dTex, dRect, ps, ps_cb, m_convert.bs, linear);
} }
void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, ID3D11BlendState* bs, bool linear) void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, bool red, bool green, bool blue, bool alpha)
{
D3D11_BLEND_DESC bd = {};
CComPtr<ID3D11BlendState> bs;
uint8 write_mask = 0;
if (red) write_mask |= D3D11_COLOR_WRITE_ENABLE_RED;
if (green) write_mask |= D3D11_COLOR_WRITE_ENABLE_GREEN;
if (blue) write_mask |= D3D11_COLOR_WRITE_ENABLE_BLUE;
if (alpha) write_mask |= D3D11_COLOR_WRITE_ENABLE_ALPHA;
bd.RenderTarget[0].RenderTargetWriteMask = write_mask;
m_dev->CreateBlendState(&bd, &bs);
StretchRect(sTex, sRect, dTex, dRect, m_convert.ps[ShaderConvert_COPY], nullptr, bs, false);
}
void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, ID3D11BlendState* bs , bool linear)
{ {
if(!sTex || !dTex) if(!sTex || !dTex)
{ {

View File

@ -513,6 +513,7 @@ public:
void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, int shader = 0, bool linear = true) final; void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, int shader = 0, bool linear = true) final;
void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, bool linear = true); void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, bool linear = true);
void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, bool red, bool green, bool blue, bool alpha);
void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, ID3D11BlendState* bs, bool linear = true); void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, ID3D11BlendState* bs, bool linear = true);
void SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vertices, bool datm); void SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vertices, bool datm);