mirror of https://github.com/PCSX2/pcsx2.git
gsdx: sed/sr/sRect/
This commit is contained in:
parent
d566bb2a23
commit
445c28fe97
|
@ -113,13 +113,13 @@ bool GPURenderer::Merge()
|
|||
|
||||
GSVector2i s = st[0]->GetSize();
|
||||
|
||||
GSVector4 sr[2];
|
||||
GSVector4 sRect[2];
|
||||
GSVector4 dr[2];
|
||||
|
||||
sr[0] = GSVector4(0, 0, 1, 1);
|
||||
sRect[0] = GSVector4(0, 0, 1, 1);
|
||||
dr[0] = GSVector4(0, 0, s.x, s.y);
|
||||
|
||||
m_dev->Merge(st, sr, dr, s, 1, 1, GSVector4(0, 0, 0, 1));
|
||||
m_dev->Merge(st, sRect, dr, s, 1, 1, GSVector4(0, 0, 0, 1));
|
||||
|
||||
if(m_shadeboost)
|
||||
{
|
||||
|
|
|
@ -217,7 +217,7 @@ GSTexture* GSDevice::GetCurrent()
|
|||
return m_current;
|
||||
}
|
||||
|
||||
void GSDevice::Merge(GSTexture* sTex[2], GSVector4* sr, GSVector4* dr, const GSVector2i& fs, bool slbg, bool mmod, const GSVector4& c)
|
||||
void GSDevice::Merge(GSTexture* sTex[2], GSVector4* sRect, GSVector4* dr, const GSVector2i& fs, bool slbg, bool mmod, const GSVector4& c)
|
||||
{
|
||||
if(m_merge == NULL || m_merge->GetSize() != fs)
|
||||
{
|
||||
|
@ -244,7 +244,7 @@ void GSDevice::Merge(GSTexture* sTex[2], GSVector4* sr, GSVector4* dr, const GSV
|
|||
}
|
||||
}
|
||||
|
||||
DoMerge(tex, sr, m_merge, dr, slbg, mmod, c);
|
||||
DoMerge(tex, sRect, m_merge, dr, slbg, mmod, c);
|
||||
|
||||
for(size_t i = 0; i < countof(tex); i++)
|
||||
{
|
||||
|
@ -321,10 +321,10 @@ void GSDevice::ExternalFX()
|
|||
|
||||
if (m_shaderfx != NULL)
|
||||
{
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0, 0, s.x, s.y);
|
||||
|
||||
StretchRect(m_current, sr, m_shaderfx, dr, 7, false);
|
||||
StretchRect(m_current, sRect, m_shaderfx, dr, 7, false);
|
||||
DoExternalFX(m_shaderfx, m_current);
|
||||
}
|
||||
}
|
||||
|
@ -341,10 +341,10 @@ void GSDevice::FXAA()
|
|||
|
||||
if(m_fxaa != NULL)
|
||||
{
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0, 0, s.x, s.y);
|
||||
|
||||
StretchRect(m_current, sr, m_fxaa, dr, 7, false);
|
||||
StretchRect(m_current, sRect, m_fxaa, dr, 7, false);
|
||||
DoFXAA(m_fxaa, m_current);
|
||||
}
|
||||
}
|
||||
|
@ -361,10 +361,10 @@ void GSDevice::ShadeBoost()
|
|||
|
||||
if(m_shadeboost != NULL)
|
||||
{
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0, 0, s.x, s.y);
|
||||
|
||||
StretchRect(m_current, sr, m_shadeboost, dr, 0, false);
|
||||
StretchRect(m_current, sRect, m_shadeboost, dr, 0, false);
|
||||
DoShadeBoost(m_shadeboost, m_current);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ protected:
|
|||
virtual GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format) = 0;
|
||||
virtual GSTexture* FetchSurface(int type, int w, int h, bool msaa, int format);
|
||||
|
||||
virtual void DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c) = 0;
|
||||
virtual void DoMerge(GSTexture* sTex[2], GSVector4* sRect, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c) = 0;
|
||||
virtual void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset) = 0;
|
||||
virtual void DoFXAA(GSTexture* sTex, GSTexture* dTex) {}
|
||||
virtual void DoShadeBoost(GSTexture* sTex, GSTexture* dTex) {}
|
||||
|
@ -141,15 +141,15 @@ public:
|
|||
|
||||
virtual GSTexture* Resolve(GSTexture* t) {return NULL;}
|
||||
|
||||
virtual GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, int h, int format = 0) {return NULL;}
|
||||
virtual GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0) {return NULL;}
|
||||
|
||||
virtual void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r) {}
|
||||
virtual void StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true) {}
|
||||
virtual void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true) {}
|
||||
|
||||
void StretchRect(GSTexture* sTex, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true);
|
||||
|
||||
virtual void PSSetShaderResources(GSTexture* sr0, GSTexture* sr1) {}
|
||||
virtual void PSSetShaderResource(int i, GSTexture* sr) {}
|
||||
virtual void PSSetShaderResource(int i, GSTexture* sRect) {}
|
||||
virtual void OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVector4i* scissor = NULL) {}
|
||||
|
||||
// Used for opengl multithread hack
|
||||
|
@ -158,7 +158,7 @@ public:
|
|||
|
||||
GSTexture* GetCurrent();
|
||||
|
||||
void Merge(GSTexture* sTex[2], GSVector4* sr, GSVector4* dr, const GSVector2i& fs, bool slbg, bool mmod, const GSVector4& c);
|
||||
void Merge(GSTexture* sTex[2], GSVector4* sRect, GSVector4* dr, const GSVector2i& fs, bool slbg, bool mmod, const GSVector4& c);
|
||||
void Interlace(const GSVector2i& ds, int field, int mode, float yoffset);
|
||||
void FXAA();
|
||||
void ShadeBoost();
|
||||
|
|
|
@ -565,7 +565,7 @@ GSTexture* GSDevice11::Resolve(GSTexture* t)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
GSTexture* GSDevice11::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, int h, int format)
|
||||
GSTexture* GSDevice11::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format)
|
||||
{
|
||||
GSTexture* dst = NULL;
|
||||
|
||||
|
@ -587,7 +587,7 @@ GSTexture* GSDevice11::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w,
|
|||
|
||||
if(GSTexture* src2 = src->IsMSAA() ? Resolve(src) : src)
|
||||
{
|
||||
StretchRect(src2, sr, rt, dr, m_convert.ps[format == DXGI_FORMAT_R16_UINT ? 1 : 0], NULL);
|
||||
StretchRect(src2, sRect, rt, dr, m_convert.ps[format == DXGI_FORMAT_R16_UINT ? 1 : 0], NULL);
|
||||
|
||||
if(src2 != src) Recycle(src2);
|
||||
}
|
||||
|
@ -618,17 +618,17 @@ void GSDevice11::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r)
|
|||
m_ctx->CopySubresourceRegion(*(GSTexture11*)dTex, 0, 0, 0, 0, *(GSTexture11*)sTex, 0, &box);
|
||||
}
|
||||
|
||||
void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
|
||||
void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
|
||||
{
|
||||
StretchRect(sTex, sr, dTex, dr, m_convert.ps[shader], NULL, linear);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_convert.ps[shader], NULL, linear);
|
||||
}
|
||||
|
||||
void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, bool linear)
|
||||
void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, bool linear)
|
||||
{
|
||||
StretchRect(sTex, sr, dTex, dr, ps, ps_cb, m_convert.bs, linear);
|
||||
StretchRect(sTex, sRect, dTex, dr, ps, ps_cb, m_convert.bs, linear);
|
||||
}
|
||||
|
||||
void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, ID3D11BlendState* bs, bool linear)
|
||||
void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, ID3D11BlendState* bs, bool linear)
|
||||
{
|
||||
if(!sTex || !dTex)
|
||||
{
|
||||
|
@ -655,10 +655,10 @@ void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dT
|
|||
|
||||
GSVertexPT1 vertices[] =
|
||||
{
|
||||
{GSVector4(left, top, 0.5f, 1.0f), GSVector2(sr.x, sr.y)},
|
||||
{GSVector4(right, top, 0.5f, 1.0f), GSVector2(sr.z, sr.y)},
|
||||
{GSVector4(left, bottom, 0.5f, 1.0f), GSVector2(sr.x, sr.w)},
|
||||
{GSVector4(right, bottom, 0.5f, 1.0f), GSVector2(sr.z, sr.w)},
|
||||
{GSVector4(left, top, 0.5f, 1.0f), GSVector2(sRect.x, sRect.y)},
|
||||
{GSVector4(right, top, 0.5f, 1.0f), GSVector2(sRect.z, sRect.y)},
|
||||
{GSVector4(left, bottom, 0.5f, 1.0f), GSVector2(sRect.x, sRect.w)},
|
||||
{GSVector4(right, bottom, 0.5f, 1.0f), GSVector2(sRect.z, sRect.w)},
|
||||
};
|
||||
|
||||
/* NVIDIA HACK!!!!
|
||||
|
@ -702,20 +702,20 @@ void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dT
|
|||
PSSetShaderResources(NULL, NULL);
|
||||
}
|
||||
|
||||
void GSDevice11::DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
|
||||
void GSDevice11::DoMerge(GSTexture* sTex[2], GSVector4* sRect, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
|
||||
{
|
||||
ClearRenderTarget(dTex, c);
|
||||
|
||||
if(sTex[1] && !slbg)
|
||||
{
|
||||
StretchRect(sTex[1], sr[1], dTex, dr[1], m_merge.ps[0], NULL, true);
|
||||
StretchRect(sTex[1], sRect[1], dTex, dr[1], m_merge.ps[0], NULL, true);
|
||||
}
|
||||
|
||||
if(sTex[0])
|
||||
{
|
||||
m_ctx->UpdateSubresource(m_merge.cb, 0, NULL, &c, 0, 0);
|
||||
|
||||
StretchRect(sTex[0], sr[0], dTex, dr[0], m_merge.ps[mmod ? 1 : 0], m_merge.cb, m_merge.bs, true);
|
||||
StretchRect(sTex[0], sRect[0], dTex, dr[0], m_merge.ps[mmod ? 1 : 0], m_merge.cb, m_merge.bs, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -723,7 +723,7 @@ void GSDevice11::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool
|
|||
{
|
||||
GSVector4 s = GSVector4(dTex->GetSize());
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0.0f, yoffset, s.x, s.y + yoffset);
|
||||
|
||||
InterlaceConstantBuffer cb;
|
||||
|
@ -733,7 +733,7 @@ void GSDevice11::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool
|
|||
|
||||
m_ctx->UpdateSubresource(m_interlace.cb, 0, NULL, &cb, 0, 0);
|
||||
|
||||
StretchRect(sTex, sr, dTex, dr, m_interlace.ps[shader], m_interlace.cb, linear);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_interlace.ps[shader], m_interlace.cb, linear);
|
||||
}
|
||||
|
||||
//Included an init function for this also. Just to be safe.
|
||||
|
@ -755,7 +755,7 @@ void GSDevice11::DoExternalFX(GSTexture* sTex, GSTexture* dTex)
|
|||
{
|
||||
GSVector2i s = dTex->GetSize();
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0, 0, s.x, s.y);
|
||||
|
||||
ExternalFXConstantBuffer cb;
|
||||
|
@ -768,7 +768,7 @@ void GSDevice11::DoExternalFX(GSTexture* sTex, GSTexture* dTex)
|
|||
|
||||
m_ctx->UpdateSubresource(m_shaderfx.cb, 0, NULL, &cb, 0, 0);
|
||||
|
||||
StretchRect(sTex, sr, dTex, dr, m_shaderfx.ps, m_shaderfx.cb, true);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_shaderfx.ps, m_shaderfx.cb, true);
|
||||
}
|
||||
|
||||
// This shouldn't be necessary, we have some bug corrupting memory
|
||||
|
@ -791,7 +791,7 @@ void GSDevice11::DoFXAA(GSTexture* sTex, GSTexture* dTex)
|
|||
{
|
||||
GSVector2i s = dTex->GetSize();
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0, 0, s.x, s.y);
|
||||
|
||||
FXAAConstantBuffer cb;
|
||||
|
@ -803,7 +803,7 @@ void GSDevice11::DoFXAA(GSTexture* sTex, GSTexture* dTex)
|
|||
|
||||
m_ctx->UpdateSubresource(m_fxaa.cb, 0, NULL, &cb, 0, 0);
|
||||
|
||||
StretchRect(sTex, sr, dTex, dr, m_fxaa.ps, m_fxaa.cb, true);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_fxaa.ps, m_fxaa.cb, true);
|
||||
|
||||
//sTex->Save("c:\\temp1\\1.bmp");
|
||||
//dTex->Save("c:\\temp1\\2.bmp");
|
||||
|
@ -813,7 +813,7 @@ void GSDevice11::DoShadeBoost(GSTexture* sTex, GSTexture* dTex)
|
|||
{
|
||||
GSVector2i s = dTex->GetSize();
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0, 0, s.x, s.y);
|
||||
|
||||
ShadeBoostConstantBuffer cb;
|
||||
|
@ -823,7 +823,7 @@ void GSDevice11::DoShadeBoost(GSTexture* sTex, GSTexture* dTex)
|
|||
|
||||
m_ctx->UpdateSubresource(m_shadeboost.cb, 0, NULL, &cb, 0, 0);
|
||||
|
||||
StretchRect(sTex, sr, dTex, dr, m_shadeboost.ps, m_shadeboost.cb, true);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_shadeboost.ps, m_shadeboost.cb, true);
|
||||
}
|
||||
|
||||
void GSDevice11::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vertices, bool datm)
|
||||
|
@ -1083,11 +1083,11 @@ void GSDevice11::PSSetShaderResources(GSTexture* sr0, GSTexture* sr1)
|
|||
}
|
||||
}
|
||||
|
||||
void GSDevice11::PSSetShaderResource(int i, GSTexture* sr)
|
||||
void GSDevice11::PSSetShaderResource(int i, GSTexture* sRect)
|
||||
{
|
||||
ID3D11ShaderResourceView* srv = NULL;
|
||||
|
||||
if(sr) srv = *(GSTexture11*)sr;
|
||||
if(sRect) srv = *(GSTexture11*)sRect;
|
||||
|
||||
PSSetShaderResourceView(i, srv);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ class GSDevice11 : public GSDeviceDX
|
|||
{
|
||||
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
|
||||
|
||||
void DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c);
|
||||
void DoMerge(GSTexture* sTex[2], GSVector4* sRect, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c);
|
||||
void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset = 0);
|
||||
void DoFXAA(GSTexture* sTex, GSTexture* dTex);
|
||||
void DoShadeBoost(GSTexture* sTex, GSTexture* dTex);
|
||||
|
@ -184,13 +184,13 @@ public:
|
|||
|
||||
GSTexture* Resolve(GSTexture* t);
|
||||
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, int h, int format = 0);
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0);
|
||||
|
||||
void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r);
|
||||
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, ID3D11BlendState* bs, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, ID3D11BlendState* bs, bool linear = true);
|
||||
|
||||
void IASetVertexBuffer(const void* vertex, size_t stride, size_t count);
|
||||
bool IAMapVertexBuffer(void** vertex, size_t stride, size_t count);
|
||||
|
@ -203,7 +203,7 @@ public:
|
|||
void VSSetShader(ID3D11VertexShader* vs, ID3D11Buffer* vs_cb);
|
||||
void GSSetShader(ID3D11GeometryShader* gs);
|
||||
void PSSetShaderResources(GSTexture* sr0, GSTexture* sr1);
|
||||
void PSSetShaderResource(int i, GSTexture* sr);
|
||||
void PSSetShaderResource(int i, GSTexture* sRect);
|
||||
void PSSetShaderResourceView(int i, ID3D11ShaderResourceView* srv);
|
||||
void PSSetShader(ID3D11PixelShader* ps, ID3D11Buffer* ps_cb);
|
||||
void PSSetSamplerState(ID3D11SamplerState* ss0, ID3D11SamplerState* ss1, ID3D11SamplerState* ss2 = NULL);
|
||||
|
|
|
@ -768,7 +768,7 @@ GSTexture* GSDevice9::Resolve(GSTexture* t)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
GSTexture* GSDevice9::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, int h, int format)
|
||||
GSTexture* GSDevice9::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format)
|
||||
{
|
||||
GSTexture* dst = NULL;
|
||||
|
||||
|
@ -790,7 +790,7 @@ GSTexture* GSDevice9::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w,
|
|||
|
||||
if(GSTexture* src2 = src->IsMSAA() ? Resolve(src) : src)
|
||||
{
|
||||
StretchRect(src2, sr, rt, dr, m_convert.ps[1], NULL, 0);
|
||||
StretchRect(src2, sRect, rt, dr, m_convert.ps[1], NULL, 0);
|
||||
|
||||
if(src2 != src) Recycle(src2);
|
||||
}
|
||||
|
@ -819,17 +819,17 @@ void GSDevice9::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r)
|
|||
m_dev->StretchRect(*(GSTexture9*)sTex, r, *(GSTexture9*)dTex, r, D3DTEXF_NONE);
|
||||
}
|
||||
|
||||
void GSDevice9::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
|
||||
void GSDevice9::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
|
||||
{
|
||||
StretchRect(sTex, sr, dTex, dr, m_convert.ps[shader], NULL, 0, linear);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_convert.ps[shader], NULL, 0, linear);
|
||||
}
|
||||
|
||||
void GSDevice9::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, IDirect3DPixelShader9* ps, const float* ps_cb, int ps_cb_len, bool linear)
|
||||
void GSDevice9::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, IDirect3DPixelShader9* ps, const float* ps_cb, int ps_cb_len, bool linear)
|
||||
{
|
||||
StretchRect(sTex, sr, dTex, dr, ps, ps_cb, ps_cb_len, &m_convert.bs, linear);
|
||||
StretchRect(sTex, sRect, dTex, dr, ps, ps_cb, ps_cb_len, &m_convert.bs, linear);
|
||||
}
|
||||
|
||||
void GSDevice9::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, IDirect3DPixelShader9* ps, const float* ps_cb, int ps_cb_len, Direct3DBlendState9* bs, bool linear)
|
||||
void GSDevice9::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, IDirect3DPixelShader9* ps, const float* ps_cb, int ps_cb_len, Direct3DBlendState9* bs, bool linear)
|
||||
{
|
||||
if(!sTex || !dTex)
|
||||
{
|
||||
|
@ -856,10 +856,10 @@ void GSDevice9::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTe
|
|||
|
||||
GSVertexPT1 vertices[] =
|
||||
{
|
||||
{GSVector4(left, top, 0.5f, 1.0f), GSVector2(sr.x, sr.y)},
|
||||
{GSVector4(right, top, 0.5f, 1.0f), GSVector2(sr.z, sr.y)},
|
||||
{GSVector4(left, bottom, 0.5f, 1.0f), GSVector2(sr.x, sr.w)},
|
||||
{GSVector4(right, bottom, 0.5f, 1.0f), GSVector2(sr.z, sr.w)},
|
||||
{GSVector4(left, top, 0.5f, 1.0f), GSVector2(sRect.x, sRect.y)},
|
||||
{GSVector4(right, top, 0.5f, 1.0f), GSVector2(sRect.z, sRect.y)},
|
||||
{GSVector4(left, bottom, 0.5f, 1.0f), GSVector2(sRect.x, sRect.w)},
|
||||
{GSVector4(right, bottom, 0.5f, 1.0f), GSVector2(sRect.z, sRect.w)},
|
||||
};
|
||||
|
||||
for(size_t i = 0; i < countof(vertices); i++)
|
||||
|
@ -891,13 +891,13 @@ void GSDevice9::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTe
|
|||
EndScene();
|
||||
}
|
||||
|
||||
void GSDevice9::DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
|
||||
void GSDevice9::DoMerge(GSTexture* sTex[2], GSVector4* sRect, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
|
||||
{
|
||||
ClearRenderTarget(dTex, c);
|
||||
|
||||
if(sTex[1] && !slbg)
|
||||
{
|
||||
StretchRect(sTex[1], sr[1], dTex, dr[1], m_merge.ps[0], NULL, true);
|
||||
StretchRect(sTex[1], sRect[1], dTex, dr[1], m_merge.ps[0], NULL, true);
|
||||
}
|
||||
|
||||
if(sTex[0])
|
||||
|
@ -906,7 +906,7 @@ void GSDevice9::DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVe
|
|||
|
||||
cb.BGColor = c;
|
||||
|
||||
StretchRect(sTex[0], sr[0], dTex, dr[0], m_merge.ps[mmod ? 1 : 0], (const float*)&cb, 1, &m_merge.bs, true);
|
||||
StretchRect(sTex[0], sRect[0], dTex, dr[0], m_merge.ps[mmod ? 1 : 0], (const float*)&cb, 1, &m_merge.bs, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -914,7 +914,7 @@ void GSDevice9::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool l
|
|||
{
|
||||
GSVector4 s = GSVector4(dTex->GetSize());
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0.0f, yoffset, s.x, s.y + yoffset);
|
||||
|
||||
InterlaceConstantBuffer cb;
|
||||
|
@ -922,7 +922,7 @@ void GSDevice9::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool l
|
|||
cb.ZrH = GSVector2(0, 1.0f / s.y);
|
||||
cb.hH = (float)s.y / 2;
|
||||
|
||||
StretchRect(sTex, sr, dTex, dr, m_interlace.ps[shader], (const float*)&cb, 1, linear);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_interlace.ps[shader], (const float*)&cb, 1, linear);
|
||||
}
|
||||
|
||||
void GSDevice9::InitExternalFX()
|
||||
|
@ -943,7 +943,7 @@ void GSDevice9::DoExternalFX(GSTexture* sTex, GSTexture* dTex)
|
|||
{
|
||||
GSVector2i s = dTex->GetSize();
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0, 0, s.x, s.y);
|
||||
|
||||
ExternalFXConstantBuffer cb;
|
||||
|
@ -954,7 +954,7 @@ void GSDevice9::DoExternalFX(GSTexture* sTex, GSTexture* dTex)
|
|||
cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f);
|
||||
cb.rcpFrameOpt = GSVector4::zero();
|
||||
|
||||
StretchRect(sTex, sr, dTex, dr, m_shaderfx.ps, (const float*)&cb, 2, true);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_shaderfx.ps, (const float*)&cb, 2, true);
|
||||
}
|
||||
|
||||
void GSDevice9::InitFXAA()
|
||||
|
@ -975,7 +975,7 @@ void GSDevice9::DoFXAA(GSTexture* sTex, GSTexture* dTex)
|
|||
{
|
||||
GSVector2i s = dTex->GetSize();
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0, 0, s.x, s.y);
|
||||
|
||||
FXAAConstantBuffer cb;
|
||||
|
@ -985,14 +985,14 @@ void GSDevice9::DoFXAA(GSTexture* sTex, GSTexture* dTex)
|
|||
cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f);
|
||||
cb.rcpFrameOpt = GSVector4::zero();
|
||||
|
||||
StretchRect(sTex, sr, dTex, dr, m_fxaa.ps, (const float*)&cb, 2, true);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_fxaa.ps, (const float*)&cb, 2, true);
|
||||
}
|
||||
|
||||
void GSDevice9::DoShadeBoost(GSTexture* sTex, GSTexture* dTex)
|
||||
{
|
||||
GSVector2i s = dTex->GetSize();
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0, 0, s.x, s.y);
|
||||
|
||||
ShadeBoostConstantBuffer cb;
|
||||
|
@ -1000,7 +1000,7 @@ void GSDevice9::DoShadeBoost(GSTexture* sTex, GSTexture* dTex)
|
|||
cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f);
|
||||
cb.rcpFrameOpt = GSVector4::zero();
|
||||
|
||||
StretchRect(sTex, sr, dTex, dr, m_shadeboost.ps, (const float*)&cb, 1, true);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_shadeboost.ps, (const float*)&cb, 1, true);
|
||||
}
|
||||
|
||||
void GSDevice9::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vertices, bool datm)
|
||||
|
@ -1234,11 +1234,11 @@ void GSDevice9::PSSetShaderResources(GSTexture* sr0, GSTexture* sr1)
|
|||
PSSetShaderResource(2, NULL);
|
||||
}
|
||||
|
||||
void GSDevice9::PSSetShaderResource(int i, GSTexture* sr)
|
||||
void GSDevice9::PSSetShaderResource(int i, GSTexture* sRect)
|
||||
{
|
||||
IDirect3DTexture9* srv = NULL;
|
||||
|
||||
if(sr) srv = *(GSTexture9*)sr;
|
||||
if(sRect) srv = *(GSTexture9*)sRect;
|
||||
|
||||
if(m_state.ps_srvs[i] != srv)
|
||||
{
|
||||
|
|
|
@ -74,7 +74,7 @@ class GSDevice9 : public GSDeviceDX
|
|||
{
|
||||
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
|
||||
|
||||
void DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c);
|
||||
void DoMerge(GSTexture* sTex[2], GSVector4* sRect, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c);
|
||||
void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset = 0);
|
||||
void DoFXAA(GSTexture* sTex, GSTexture* dTex);
|
||||
void DoShadeBoost(GSTexture* sTex, GSTexture* dTex);
|
||||
|
@ -209,13 +209,13 @@ public:
|
|||
|
||||
GSTexture* Resolve(GSTexture* t);
|
||||
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, int h, int format = 0);
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0);
|
||||
|
||||
void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r);
|
||||
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, IDirect3DPixelShader9* ps, const float* ps_cb, int ps_cb_len, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, IDirect3DPixelShader9* ps, const float* ps_cb, int ps_cb_len, Direct3DBlendState9* bs, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, IDirect3DPixelShader9* ps, const float* ps_cb, int ps_cb_len, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, IDirect3DPixelShader9* ps, const float* ps_cb, int ps_cb_len, Direct3DBlendState9* bs, bool linear = true);
|
||||
|
||||
void IASetVertexBuffer(const void* vertex, size_t stride, size_t count);
|
||||
bool IAMapVertexBuffer(void** vertex, size_t stride, size_t count);
|
||||
|
@ -227,7 +227,7 @@ public:
|
|||
void IASetPrimitiveTopology(D3DPRIMITIVETYPE topology);
|
||||
void VSSetShader(IDirect3DVertexShader9* vs, const float* vs_cb, int vs_cb_len);
|
||||
void PSSetShaderResources(GSTexture* sr0, GSTexture* sr1);
|
||||
void PSSetShaderResource(int i, GSTexture* sr);
|
||||
void PSSetShaderResource(int i, GSTexture* sRect);
|
||||
void PSSetShader(IDirect3DPixelShader9* ps, const float* ps_cb, int ps_cb_len);
|
||||
void PSSetSamplerState(Direct3DSamplerState9* ss);
|
||||
void OMSetDepthStencilState(Direct3DDepthStencilState9* dss);
|
||||
|
|
|
@ -29,7 +29,7 @@ class GSDeviceNull : public GSDevice
|
|||
private:
|
||||
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
|
||||
|
||||
void DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c) {}
|
||||
void DoMerge(GSTexture* sTex[2], GSVector4* sRect, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c) {}
|
||||
void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset = 0) {}
|
||||
|
||||
public:
|
||||
|
|
|
@ -684,7 +684,7 @@ GSTexture* GSDeviceOGL::CreateOffscreen(int w, int h, int format)
|
|||
}
|
||||
|
||||
// blit a texture into an offscreen buffer
|
||||
GSTexture* GSDeviceOGL::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, int h, int format)
|
||||
GSTexture* GSDeviceOGL::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format)
|
||||
{
|
||||
ASSERT(src);
|
||||
ASSERT(format == GL_RGBA8 || format == GL_R16UI);
|
||||
|
@ -696,7 +696,7 @@ GSTexture* GSDeviceOGL::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w
|
|||
GSTexture* dst = CreateOffscreen(w, h, format);
|
||||
GSVector4 dr(0, 0, w, h);
|
||||
|
||||
StretchRect(src, sr, dst, dr, m_convert.ps[format == GL_R16UI ? 1 : 0]);
|
||||
StretchRect(src, sRect, dst, dr, m_convert.ps[format == GL_R16UI ? 1 : 0]);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
@ -733,17 +733,17 @@ void GSDeviceOGL::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r
|
|||
GL_POP();
|
||||
}
|
||||
|
||||
void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
|
||||
void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
|
||||
{
|
||||
StretchRect(sTex, sr, dTex, dr, m_convert.ps[shader], linear);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_convert.ps[shader], linear);
|
||||
}
|
||||
|
||||
void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, GLuint ps, bool linear)
|
||||
void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, GLuint ps, bool linear)
|
||||
{
|
||||
StretchRect(sTex, sr, dTex, dr, ps, m_convert.bs, linear);
|
||||
StretchRect(sTex, sRect, dTex, dr, ps, m_convert.bs, linear);
|
||||
}
|
||||
|
||||
void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, GLuint ps, GSBlendStateOGL* bs, bool linear)
|
||||
void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, GLuint ps, GSBlendStateOGL* bs, bool linear)
|
||||
{
|
||||
if(!sTex || !dTex)
|
||||
{
|
||||
|
@ -801,10 +801,10 @@ void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* d
|
|||
// 1/ consistency between several pass rendering (interlace)
|
||||
// 2/ in case some GSdx code expect thing in dx order.
|
||||
// Only flipping the backbuffer is transparent (I hope)...
|
||||
GSVector4 flip_sr = sr;
|
||||
GSVector4 flip_sr = sRect;
|
||||
if (static_cast<GSTextureOGL*>(dTex)->IsBackbuffer()) {
|
||||
flip_sr.y = sr.w;
|
||||
flip_sr.w = sr.y;
|
||||
flip_sr.y = sRect.w;
|
||||
flip_sr.w = sRect.y;
|
||||
}
|
||||
|
||||
GSVertexPT1 vertices[] =
|
||||
|
@ -844,7 +844,7 @@ void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* d
|
|||
GL_POP();
|
||||
}
|
||||
|
||||
void GSDeviceOGL::DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
|
||||
void GSDeviceOGL::DoMerge(GSTexture* sTex[2], GSVector4* sRect, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
|
||||
{
|
||||
GL_PUSH("DoMerge");
|
||||
|
||||
|
@ -854,14 +854,14 @@ void GSDeviceOGL::DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GS
|
|||
|
||||
if(sTex[1] && !slbg)
|
||||
{
|
||||
StretchRect(sTex[1], sr[1], dTex, dr[1], m_merge_obj.ps[0]);
|
||||
StretchRect(sTex[1], sRect[1], dTex, dr[1], m_merge_obj.ps[0]);
|
||||
}
|
||||
|
||||
if(sTex[0])
|
||||
{
|
||||
m_merge_obj.cb->upload(&c.v);
|
||||
|
||||
StretchRect(sTex[0], sr[0], dTex, dr[0], m_merge_obj.ps[mmod ? 1 : 0], m_merge_obj.bs);
|
||||
StretchRect(sTex[0], sRect[0], dTex, dr[0], m_merge_obj.ps[mmod ? 1 : 0], m_merge_obj.bs);
|
||||
}
|
||||
|
||||
GL_POP();
|
||||
|
@ -875,7 +875,7 @@ void GSDeviceOGL::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool
|
|||
|
||||
GSVector4 s = GSVector4(dTex->GetSize());
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0.0f, yoffset, s.x, s.y + yoffset);
|
||||
|
||||
InterlaceConstantBuffer cb;
|
||||
|
@ -885,7 +885,7 @@ void GSDeviceOGL::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool
|
|||
|
||||
m_interlace.cb->upload(&cb);
|
||||
|
||||
StretchRect(sTex, sr, dTex, dr, m_interlace.ps[shader], linear);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_interlace.ps[shader], linear);
|
||||
|
||||
GL_POP();
|
||||
}
|
||||
|
@ -909,10 +909,10 @@ void GSDeviceOGL::DoFXAA(GSTexture* sTex, GSTexture* dTex)
|
|||
|
||||
GSVector2i s = dTex->GetSize();
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0, 0, s.x, s.y);
|
||||
|
||||
StretchRect(sTex, sr, dTex, dr, m_fxaa.ps, true);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_fxaa.ps, true);
|
||||
|
||||
GL_POP();
|
||||
}
|
||||
|
@ -947,7 +947,7 @@ void GSDeviceOGL::DoExternalFX(GSTexture* sTex, GSTexture* dTex)
|
|||
|
||||
GSVector2i s = dTex->GetSize();
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0, 0, s.x, s.y);
|
||||
|
||||
ExternalFXConstantBuffer cb;
|
||||
|
@ -958,7 +958,7 @@ void GSDeviceOGL::DoExternalFX(GSTexture* sTex, GSTexture* dTex)
|
|||
|
||||
m_shaderfx.cb->upload(&cb);
|
||||
|
||||
StretchRect(sTex, sr, dTex, dr, m_shaderfx.ps, true);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_shaderfx.ps, true);
|
||||
|
||||
GL_POP();
|
||||
}
|
||||
|
@ -971,7 +971,7 @@ void GSDeviceOGL::DoShadeBoost(GSTexture* sTex, GSTexture* dTex)
|
|||
|
||||
GSVector2i s = dTex->GetSize();
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0, 0, s.x, s.y);
|
||||
|
||||
ShadeBoostConstantBuffer cb;
|
||||
|
@ -981,7 +981,7 @@ void GSDeviceOGL::DoShadeBoost(GSTexture* sTex, GSTexture* dTex)
|
|||
|
||||
m_shadeboost.cb->upload(&cb);
|
||||
|
||||
StretchRect(sTex, sr, dTex, dr, m_shadeboost.ps, true);
|
||||
StretchRect(sTex, sRect, dTex, dr, m_shadeboost.ps, true);
|
||||
|
||||
GL_POP();
|
||||
}
|
||||
|
@ -1058,9 +1058,9 @@ void GSDeviceOGL::IASetPrimitiveTopology(GLenum topology)
|
|||
m_va->SetTopology(topology);
|
||||
}
|
||||
|
||||
void GSDeviceOGL::PSSetShaderResource(int i, GSTexture* sr)
|
||||
void GSDeviceOGL::PSSetShaderResource(int i, GSTexture* sRect)
|
||||
{
|
||||
GLuint id = sr->GetID();
|
||||
GLuint id = sRect->GetID();
|
||||
if (GLState::tex_unit[i] != id) {
|
||||
GLState::tex_unit[i] = id;
|
||||
gl_BindTextureUnit(i, id);
|
||||
|
|
|
@ -536,7 +536,7 @@ class GSDeviceOGL : public GSDevice
|
|||
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
|
||||
GSTexture* FetchSurface(int type, int w, int h, bool msaa, int format);
|
||||
|
||||
void DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c);
|
||||
void DoMerge(GSTexture* sTex[2], GSVector4* sRect, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c);
|
||||
void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset = 0);
|
||||
void DoFXAA(GSTexture* sTex, GSTexture* dTex);
|
||||
void DoShadeBoost(GSTexture* sTex, GSTexture* dTex);
|
||||
|
@ -585,12 +585,12 @@ class GSDeviceOGL : public GSDevice
|
|||
void InitPrimDateTexture(GSTexture* rt);
|
||||
void RecycleDateTexture();
|
||||
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, int h, int format = 0);
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0);
|
||||
|
||||
void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, GLuint ps, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, GLuint ps, GSBlendStateOGL* bs, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, GLuint ps, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, GLuint ps, GSBlendStateOGL* bs, bool linear = true);
|
||||
|
||||
void SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vertices, bool datm);
|
||||
|
||||
|
@ -600,7 +600,7 @@ class GSDeviceOGL : public GSDevice
|
|||
void IASetVertexBuffer(const void* vertices, size_t count);
|
||||
void IASetIndexBuffer(const void* index, size_t count);
|
||||
|
||||
void PSSetShaderResource(int i, GSTexture* sr);
|
||||
void PSSetShaderResource(int i, GSTexture* sRect);
|
||||
void PSSetShaderResources(GSTexture* sr0, GSTexture* sr1);
|
||||
void PSSetSamplerState(GLuint ss);
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ void GSDeviceSW::ClearStencil(GSTexture* t, uint8 c)
|
|||
Clear(t, c);
|
||||
}
|
||||
|
||||
GSTexture* GSDeviceSW::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, int h, int format)
|
||||
GSTexture* GSDeviceSW::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format)
|
||||
{
|
||||
GSTexture* dst = CreateOffscreen(w, h, format);
|
||||
|
||||
|
@ -207,7 +207,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
template<class SHADER> static void StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, const SHADER& shader, bool linear)
|
||||
template<class SHADER> static void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, const SHADER& shader, bool linear)
|
||||
{
|
||||
GSVector4i r(dr.ceil());
|
||||
|
||||
|
@ -226,7 +226,7 @@ template<class SHADER> static void StretchRect(GSTexture* sTex, const GSVector4&
|
|||
GSVector2i ssize = sTex->GetSize();
|
||||
|
||||
GSVector4 p = dr;
|
||||
GSVector4 t = sr * GSVector4(ssize).xyxy() * GSVector4((float)0x10000);
|
||||
GSVector4 t = sRect * GSVector4(ssize).xyxy() * GSVector4((float)0x10000);
|
||||
|
||||
GSVector4 tl = p.xyxy(t);
|
||||
GSVector4 br = p.zwzw(t);
|
||||
|
@ -301,13 +301,13 @@ template<class SHADER> static void StretchRect(GSTexture* sTex, const GSVector4&
|
|||
dTex->Unmap();
|
||||
}
|
||||
|
||||
void GSDeviceSW::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
|
||||
void GSDeviceSW::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
|
||||
{
|
||||
// TODO: if dTex == m_backbuffer && m_backbuffer is special
|
||||
|
||||
if(shader == 0)
|
||||
{
|
||||
if((sr == GSVector4(0, 0, 1, 1) & dr == GSVector4(dTex->GetSize()).zwxy()).alltrue() && sTex->GetSize() == dTex->GetSize())
|
||||
if((sRect == GSVector4(0, 0, 1, 1) & dr == GSVector4(dTex->GetSize()).zwxy()).alltrue() && sTex->GetSize() == dTex->GetSize())
|
||||
{
|
||||
// shortcut
|
||||
|
||||
|
@ -318,13 +318,13 @@ void GSDeviceSW::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dT
|
|||
|
||||
ShaderCopy s;
|
||||
|
||||
::StretchRect(sTex, sr, dTex, dr, s, linear);
|
||||
::StretchRect(sTex, sRect, dTex, dr, s, linear);
|
||||
}
|
||||
else if(shader == 1)
|
||||
{
|
||||
ShaderAlphaBlend s;
|
||||
|
||||
::StretchRect(sTex, sr, dTex, dr, s, linear);
|
||||
::StretchRect(sTex, sRect, dTex, dr, s, linear);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -337,7 +337,7 @@ void GSDeviceSW::PSSetShaderResources(GSTexture* sr0, GSTexture* sr1)
|
|||
// TODO
|
||||
}
|
||||
|
||||
void GSDeviceSW::PSSetShaderResource(int i, GSTexture* sr)
|
||||
void GSDeviceSW::PSSetShaderResource(int i, GSTexture* sRect)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
@ -349,13 +349,13 @@ void GSDeviceSW::OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVector
|
|||
|
||||
//
|
||||
|
||||
void GSDeviceSW::DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
|
||||
void GSDeviceSW::DoMerge(GSTexture* sTex[2], GSVector4* sRect, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
|
||||
{
|
||||
ClearRenderTarget(dTex, c);
|
||||
|
||||
if(sTex[1] && !slbg)
|
||||
{
|
||||
StretchRect(sTex[1], sr[1], dTex, dr[1]);
|
||||
StretchRect(sTex[1], sRect[1], dTex, dr[1]);
|
||||
}
|
||||
|
||||
if(sTex[0])
|
||||
|
@ -366,7 +366,7 @@ void GSDeviceSW::DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSV
|
|||
|
||||
ShaderAlpha2xBlend s;
|
||||
|
||||
::StretchRect(sTex[0], sr[0], dTex, dr[0], s, true);
|
||||
::StretchRect(sTex[0], sRect[0], dTex, dr[0], s, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -374,7 +374,7 @@ void GSDeviceSW::DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSV
|
|||
|
||||
ShaderFactorBlend s((uint32)(int)(c.a * 255));
|
||||
|
||||
::StretchRect(sTex[0], sr[0], dTex, dr[0], s, true);
|
||||
::StretchRect(sTex[0], sRect[0], dTex, dr[0], s, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -385,7 +385,7 @@ void GSDeviceSW::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool
|
|||
{
|
||||
GSVector4 s = GSVector4(dTex->GetSize());
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 sRect(0, 0, 1, 1);
|
||||
GSVector4 dr(0.0f, yoffset, s.x, s.y + yoffset);
|
||||
|
||||
if(shader == 0 || shader == 1)
|
||||
|
@ -398,7 +398,7 @@ void GSDeviceSW::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool
|
|||
}
|
||||
else if(shader == 3)
|
||||
{
|
||||
StretchRect(sTex, sr, dTex, dr, 0, linear);
|
||||
StretchRect(sTex, sRect, dTex, dr, 0, linear);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@ class GSDeviceSW : public GSDevice
|
|||
{
|
||||
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
|
||||
|
||||
void DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c);
|
||||
void DoMerge(GSTexture* sTex[2], GSVector4* sRect, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c);
|
||||
void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset = 0);
|
||||
|
||||
void Clear(GSTexture* t, uint32 c);
|
||||
|
@ -50,13 +50,13 @@ public:
|
|||
void ClearDepth(GSTexture* t, float c);
|
||||
void ClearStencil(GSTexture* t, uint8 c);
|
||||
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, int h, int format = 0);
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0);
|
||||
|
||||
void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true);
|
||||
void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true);
|
||||
|
||||
void PSSetShaderResources(GSTexture* sr0, GSTexture* sr1);
|
||||
void PSSetShaderResource(int i, GSTexture* sr);
|
||||
void PSSetShaderResource(int i, GSTexture* sRect);
|
||||
void OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVector4i* scissor = NULL);
|
||||
};
|
||||
|
||||
|
|
|
@ -962,9 +962,9 @@ void GSRasterizer::DrawEdge(const GSVertexSW& v0, const GSVertexSW& v1, const GS
|
|||
else
|
||||
{
|
||||
GSVector4 lrf = v0.p.xxxx(v1.p).ceil(); // l l r r
|
||||
GSVector4 lrmax = lrf.max(m_fscissor_x); // max(l, sl) max(l, sr) max(r, sl) max(r, sr)
|
||||
GSVector4 lrmin = lrf.min(m_fscissor_x); // min(l, sl) min(l, sr) min(r, sl) min(r, sr)
|
||||
GSVector4i lr = GSVector4i(lrmax.xzyw(lrmin)); // max(l, sl) max(r, sl) min(l, sr) min(r, sr)
|
||||
GSVector4 lrmax = lrf.max(m_fscissor_x); // max(l, sl) max(l, sRect) max(r, sl) max(r, sRect)
|
||||
GSVector4 lrmin = lrf.min(m_fscissor_x); // min(l, sl) min(l, sRect) min(r, sl) min(r, sRect)
|
||||
GSVector4i lr = GSVector4i(lrmax.xzyw(lrmin)); // max(l, sl) max(r, sl) min(l, sRect) min(r, sRect)
|
||||
|
||||
int left, right;
|
||||
|
||||
|
@ -973,7 +973,7 @@ void GSRasterizer::DrawEdge(const GSVertexSW& v0, const GSVertexSW& v1, const GS
|
|||
if((dv.p >= GSVector4::zero()).mask() & 1)
|
||||
{
|
||||
left = lr.extract32<0>(); // max(l, sl)
|
||||
right = lr.extract32<3>(); // min(r, sr)
|
||||
right = lr.extract32<3>(); // min(r, sRect)
|
||||
|
||||
if(left >= right) return;
|
||||
|
||||
|
@ -985,7 +985,7 @@ void GSRasterizer::DrawEdge(const GSVertexSW& v0, const GSVertexSW& v1, const GS
|
|||
else
|
||||
{
|
||||
left = lr.extract32<1>(); // max(r, sl)
|
||||
right = lr.extract32<2>(); // min(l, sr)
|
||||
right = lr.extract32<2>(); // min(l, sRect)
|
||||
|
||||
if(left >= right) return;
|
||||
|
||||
|
|
|
@ -703,10 +703,10 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
|
|||
// int sx = off % sw;
|
||||
// int sy = off / sw;
|
||||
|
||||
// GSVector4 sr = GSVector4(GSVector4i(sx, sy).xyxy() + br) * scale / size;
|
||||
// GSVector4 sRect = GSVector4(GSVector4i(sx, sy).xyxy() + br) * scale / size;
|
||||
// GSVector4 dr = GSVector4(GSVector4i(dx, dy).xyxy() + br) * scale;
|
||||
|
||||
// m_renderer->m_dev->StretchRect(dst->m_texture, sr, src->m_texture, dr);
|
||||
// m_renderer->m_dev->StretchRect(dst->m_texture, sRect, src->m_texture, dr);
|
||||
|
||||
// // TODO: this is quite a lot of StretchRect, do it with one Draw
|
||||
// }
|
||||
|
@ -742,7 +742,7 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
|
|||
h = dstsize.y;
|
||||
}
|
||||
|
||||
GSVector4 sr(0, 0, w, h);
|
||||
GSVector4 sRect(0, 0, w, h);
|
||||
|
||||
GSTexture* sTex = src->m_texture ? src->m_texture : dst->m_texture;
|
||||
GSTexture* dTex = m_renderer->m_dev->CreateRenderTarget(w, h, false);
|
||||
|
@ -757,16 +757,16 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
|
|||
src->m_texture = dTex;
|
||||
}
|
||||
|
||||
if((sr == dr).alltrue())
|
||||
if((sRect == dr).alltrue())
|
||||
{
|
||||
m_renderer->m_dev->CopyRect(sTex, dTex, GSVector4i(0, 0, w, h));
|
||||
}
|
||||
else
|
||||
{
|
||||
sr.z /= sTex->GetWidth();
|
||||
sr.w /= sTex->GetHeight();
|
||||
sRect.z /= sTex->GetWidth();
|
||||
sRect.w /= sTex->GetHeight();
|
||||
|
||||
m_renderer->m_dev->StretchRect(sTex, sr, dTex, dr);
|
||||
m_renderer->m_dev->StretchRect(sTex, sRect, dTex, dr);
|
||||
}
|
||||
|
||||
if(dTex != src->m_texture)
|
||||
|
|
Loading…
Reference in New Issue