gsdx: sed /st/sTex/

This commit is contained in:
Gregory Hainaut 2015-05-15 20:45:31 +02:00
parent 6a9e425308
commit d566bb2a23
15 changed files with 167 additions and 167 deletions

View File

@ -122,9 +122,9 @@ void GSDevice::Present(const GSVector4i& r, int shader)
GL_POP();
}
void GSDevice::Present(GSTexture* st, GSTexture* dTex, const GSVector4& dr, int shader)
void GSDevice::Present(GSTexture* sTex, GSTexture* dTex, const GSVector4& dr, int shader)
{
StretchRect(st, dTex, dr, shader);
StretchRect(sTex, dTex, dr, shader);
}
GSTexture* GSDevice::FetchSurface(int type, int w, int h, bool msaa, int format)
@ -207,9 +207,9 @@ GSTexture* GSDevice::CreateOffscreen(int w, int h, int format)
return FetchSurface(GSTexture::Offscreen, w, h, false, format);
}
void GSDevice::StretchRect(GSTexture* st, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
void GSDevice::StretchRect(GSTexture* sTex, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
{
StretchRect(st, GSVector4(0, 0, 1, 1), dTex, dr, shader, linear);
StretchRect(sTex, GSVector4(0, 0, 1, 1), dTex, dr, shader, linear);
}
GSTexture* GSDevice::GetCurrent()
@ -217,7 +217,7 @@ GSTexture* GSDevice::GetCurrent()
return m_current;
}
void GSDevice::Merge(GSTexture* st[2], GSVector4* sr, GSVector4* dr, const GSVector2i& fs, bool slbg, bool mmod, const GSVector4& c)
void GSDevice::Merge(GSTexture* sTex[2], GSVector4* sr, GSVector4* dr, const GSVector2i& fs, bool slbg, bool mmod, const GSVector4& c)
{
if(m_merge == NULL || m_merge->GetSize() != fs)
{
@ -238,9 +238,9 @@ void GSDevice::Merge(GSTexture* st[2], GSVector4* sr, GSVector4* dr, const GSVec
for(size_t i = 0; i < countof(tex); i++)
{
if(st[i] != NULL)
if(sTex[i] != NULL)
{
tex[i] = st[i]->IsMSAA() ? Resolve(st[i]) : st[i];
tex[i] = sTex[i]->IsMSAA() ? Resolve(sTex[i]) : sTex[i];
}
}
@ -248,7 +248,7 @@ void GSDevice::Merge(GSTexture* st[2], GSVector4* sr, GSVector4* dr, const GSVec
for(size_t i = 0; i < countof(tex); i++)
{
if(tex[i] != st[i])
if(tex[i] != sTex[i])
{
Recycle(tex[i]);
}

View File

@ -100,11 +100,11 @@ 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* st[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c) = 0;
virtual void DoInterlace(GSTexture* st, GSTexture* dTex, int shader, bool linear, float yoffset) = 0;
virtual void DoFXAA(GSTexture* st, GSTexture* dTex) {}
virtual void DoShadeBoost(GSTexture* st, GSTexture* dTex) {}
virtual void DoExternalFX(GSTexture* st, GSTexture* dTex) {}
virtual void DoMerge(GSTexture* sTex[2], GSVector4* sr, 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) {}
virtual void DoExternalFX(GSTexture* sTex, GSTexture* dTex) {}
public:
GSDevice();
@ -118,7 +118,7 @@ public:
virtual bool Reset(int w, int h);
virtual bool IsLost(bool update = false) {return false;}
virtual void Present(const GSVector4i& r, int shader);
virtual void Present(GSTexture* st, GSTexture* dTex, const GSVector4& dr, int shader = 0);
virtual void Present(GSTexture* sTex, GSTexture* dTex, const GSVector4& dr, int shader = 0);
virtual void Flip() {}
virtual void SetVSync(bool enable) {m_vsync = enable;}
@ -143,10 +143,10 @@ public:
virtual GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, int h, int format = 0) {return NULL;}
virtual void CopyRect(GSTexture* st, GSTexture* dTex, const GSVector4i& r) {}
virtual void StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true) {}
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) {}
void StretchRect(GSTexture* st, 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) {}
@ -158,7 +158,7 @@ public:
GSTexture* GetCurrent();
void Merge(GSTexture* st[2], GSVector4* sr, GSVector4* dr, const GSVector2i& fs, bool slbg, bool mmod, const GSVector4& c);
void Merge(GSTexture* sTex[2], GSVector4* sr, 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();

View File

@ -605,9 +605,9 @@ GSTexture* GSDevice11::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w,
return dst;
}
void GSDevice11::CopyRect(GSTexture* st, GSTexture* dTex, const GSVector4i& r)
void GSDevice11::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r)
{
if(!st || !dTex)
if(!sTex || !dTex)
{
ASSERT(0);
return;
@ -615,22 +615,22 @@ void GSDevice11::CopyRect(GSTexture* st, GSTexture* dTex, const GSVector4i& r)
D3D11_BOX box = {r.left, r.top, 0, r.right, r.bottom, 1};
m_ctx->CopySubresourceRegion(*(GSTexture11*)dTex, 0, 0, 0, 0, *(GSTexture11*)st, 0, &box);
m_ctx->CopySubresourceRegion(*(GSTexture11*)dTex, 0, 0, 0, 0, *(GSTexture11*)sTex, 0, &box);
}
void GSDevice11::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
{
StretchRect(st, sr, dTex, dr, m_convert.ps[shader], NULL, linear);
StretchRect(sTex, sr, dTex, dr, m_convert.ps[shader], NULL, linear);
}
void GSDevice11::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, bool linear)
void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, bool linear)
{
StretchRect(st, sr, dTex, dr, ps, ps_cb, m_convert.bs, linear);
StretchRect(sTex, sr, dTex, dr, ps, ps_cb, m_convert.bs, linear);
}
void GSDevice11::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, ID3D11BlendState* bs, bool linear)
void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, ID3D11BlendState* bs, bool linear)
{
if(!st || !dTex)
if(!sTex || !dTex)
{
ASSERT(0);
return;
@ -687,7 +687,7 @@ void GSDevice11::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex
// ps
PSSetShaderResources(st, NULL);
PSSetShaderResources(sTex, NULL);
PSSetSamplerState(linear ? m_convert.ln : m_convert.pt, NULL);
PSSetShader(ps, ps_cb);
@ -702,24 +702,24 @@ void GSDevice11::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex
PSSetShaderResources(NULL, NULL);
}
void GSDevice11::DoMerge(GSTexture* st[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
void GSDevice11::DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
{
ClearRenderTarget(dTex, c);
if(st[1] && !slbg)
if(sTex[1] && !slbg)
{
StretchRect(st[1], sr[1], dTex, dr[1], m_merge.ps[0], NULL, true);
StretchRect(sTex[1], sr[1], dTex, dr[1], m_merge.ps[0], NULL, true);
}
if(st[0])
if(sTex[0])
{
m_ctx->UpdateSubresource(m_merge.cb, 0, NULL, &c, 0, 0);
StretchRect(st[0], sr[0], dTex, dr[0], m_merge.ps[mmod ? 1 : 0], m_merge.cb, m_merge.bs, true);
StretchRect(sTex[0], sr[0], dTex, dr[0], m_merge.ps[mmod ? 1 : 0], m_merge.cb, m_merge.bs, true);
}
}
void GSDevice11::DoInterlace(GSTexture* st, GSTexture* dTex, int shader, bool linear, float yoffset)
void GSDevice11::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset)
{
GSVector4 s = GSVector4(dTex->GetSize());
@ -733,7 +733,7 @@ void GSDevice11::DoInterlace(GSTexture* st, GSTexture* dTex, int shader, bool li
m_ctx->UpdateSubresource(m_interlace.cb, 0, NULL, &cb, 0, 0);
StretchRect(st, sr, dTex, dr, m_interlace.ps[shader], m_interlace.cb, linear);
StretchRect(sTex, sr, dTex, dr, m_interlace.ps[shader], m_interlace.cb, linear);
}
//Included an init function for this also. Just to be safe.
@ -751,7 +751,7 @@ void GSDevice11::InitExternalFX()
}
}
void GSDevice11::DoExternalFX(GSTexture* st, GSTexture* dTex)
void GSDevice11::DoExternalFX(GSTexture* sTex, GSTexture* dTex)
{
GSVector2i s = dTex->GetSize();
@ -768,7 +768,7 @@ void GSDevice11::DoExternalFX(GSTexture* st, GSTexture* dTex)
m_ctx->UpdateSubresource(m_shaderfx.cb, 0, NULL, &cb, 0, 0);
StretchRect(st, sr, dTex, dr, m_shaderfx.ps, m_shaderfx.cb, true);
StretchRect(sTex, sr, dTex, dr, m_shaderfx.ps, m_shaderfx.cb, true);
}
// This shouldn't be necessary, we have some bug corrupting memory
@ -787,7 +787,7 @@ void GSDevice11::InitFXAA()
}
}
void GSDevice11::DoFXAA(GSTexture* st, GSTexture* dTex)
void GSDevice11::DoFXAA(GSTexture* sTex, GSTexture* dTex)
{
GSVector2i s = dTex->GetSize();
@ -803,13 +803,13 @@ void GSDevice11::DoFXAA(GSTexture* st, GSTexture* dTex)
m_ctx->UpdateSubresource(m_fxaa.cb, 0, NULL, &cb, 0, 0);
StretchRect(st, sr, dTex, dr, m_fxaa.ps, m_fxaa.cb, true);
StretchRect(sTex, sr, dTex, dr, m_fxaa.ps, m_fxaa.cb, true);
//st->Save("c:\\temp1\\1.bmp");
//sTex->Save("c:\\temp1\\1.bmp");
//dTex->Save("c:\\temp1\\2.bmp");
}
void GSDevice11::DoShadeBoost(GSTexture* st, GSTexture* dTex)
void GSDevice11::DoShadeBoost(GSTexture* sTex, GSTexture* dTex)
{
GSVector2i s = dTex->GetSize();
@ -823,7 +823,7 @@ void GSDevice11::DoShadeBoost(GSTexture* st, GSTexture* dTex)
m_ctx->UpdateSubresource(m_shadeboost.cb, 0, NULL, &cb, 0, 0);
StretchRect(st, sr, dTex, dr, m_shadeboost.ps, m_shadeboost.cb, true);
StretchRect(sTex, sr, dTex, dr, m_shadeboost.ps, m_shadeboost.cb, true);
}
void GSDevice11::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vertices, bool datm)

View File

@ -34,11 +34,11 @@ class GSDevice11 : public GSDeviceDX
{
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
void DoMerge(GSTexture* st[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c);
void DoInterlace(GSTexture* st, GSTexture* dTex, int shader, bool linear, float yoffset = 0);
void DoFXAA(GSTexture* st, GSTexture* dTex);
void DoShadeBoost(GSTexture* st, GSTexture* dTex);
void DoExternalFX(GSTexture* st, GSTexture* dTex);
void DoMerge(GSTexture* sTex[2], GSVector4* sr, 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);
void DoExternalFX(GSTexture* sTex, GSTexture* dTex);
void InitExternalFX();
void InitFXAA(); // Bug workaround! Stack corruption? Heap corruption? No idea
@ -186,11 +186,11 @@ public:
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, int h, int format = 0);
void CopyRect(GSTexture* st, GSTexture* dTex, const GSVector4i& r);
void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r);
void StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true);
void StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, bool linear = true);
void StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, ID3D11BlendState* bs, bool linear = true);
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 IASetVertexBuffer(const void* vertex, size_t stride, size_t count);
bool IAMapVertexBuffer(void** vertex, size_t stride, size_t count);

View File

@ -808,30 +808,30 @@ GSTexture* GSDevice9::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w,
return dst;
}
void GSDevice9::CopyRect(GSTexture* st, GSTexture* dTex, const GSVector4i& r)
void GSDevice9::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r)
{
if(!st || !dTex)
if(!sTex || !dTex)
{
ASSERT(0);
return;
}
m_dev->StretchRect(*(GSTexture9*)st, r, *(GSTexture9*)dTex, r, D3DTEXF_NONE);
m_dev->StretchRect(*(GSTexture9*)sTex, r, *(GSTexture9*)dTex, r, D3DTEXF_NONE);
}
void GSDevice9::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
void GSDevice9::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
{
StretchRect(st, sr, dTex, dr, m_convert.ps[shader], NULL, 0, linear);
StretchRect(sTex, sr, dTex, dr, m_convert.ps[shader], NULL, 0, linear);
}
void GSDevice9::StretchRect(GSTexture* st, 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& sr, GSTexture* dTex, const GSVector4& dr, IDirect3DPixelShader9* ps, const float* ps_cb, int ps_cb_len, bool linear)
{
StretchRect(st, sr, dTex, dr, ps, ps_cb, ps_cb_len, &m_convert.bs, linear);
StretchRect(sTex, sr, dTex, dr, ps, ps_cb, ps_cb_len, &m_convert.bs, linear);
}
void GSDevice9::StretchRect(GSTexture* st, 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& sr, GSTexture* dTex, const GSVector4& dr, IDirect3DPixelShader9* ps, const float* ps_cb, int ps_cb_len, Direct3DBlendState9* bs, bool linear)
{
if(!st || !dTex)
if(!sTex || !dTex)
{
ASSERT(0);
return;
@ -879,7 +879,7 @@ void GSDevice9::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex,
// ps
PSSetSamplerState(linear ? &m_convert.ln : &m_convert.pt);
PSSetShaderResources(st, NULL);
PSSetShaderResources(sTex, NULL);
PSSetShader(ps, ps_cb, ps_cb_len);
//
@ -891,26 +891,26 @@ void GSDevice9::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex,
EndScene();
}
void GSDevice9::DoMerge(GSTexture* st[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
void GSDevice9::DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
{
ClearRenderTarget(dTex, c);
if(st[1] && !slbg)
if(sTex[1] && !slbg)
{
StretchRect(st[1], sr[1], dTex, dr[1], m_merge.ps[0], NULL, true);
StretchRect(sTex[1], sr[1], dTex, dr[1], m_merge.ps[0], NULL, true);
}
if(st[0])
if(sTex[0])
{
MergeConstantBuffer cb;
cb.BGColor = c;
StretchRect(st[0], sr[0], dTex, dr[0], m_merge.ps[mmod ? 1 : 0], (const float*)&cb, 1, &m_merge.bs, true);
StretchRect(sTex[0], sr[0], dTex, dr[0], m_merge.ps[mmod ? 1 : 0], (const float*)&cb, 1, &m_merge.bs, true);
}
}
void GSDevice9::DoInterlace(GSTexture* st, GSTexture* dTex, int shader, bool linear, float yoffset)
void GSDevice9::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset)
{
GSVector4 s = GSVector4(dTex->GetSize());
@ -922,7 +922,7 @@ void GSDevice9::DoInterlace(GSTexture* st, GSTexture* dTex, int shader, bool lin
cb.ZrH = GSVector2(0, 1.0f / s.y);
cb.hH = (float)s.y / 2;
StretchRect(st, sr, dTex, dr, m_interlace.ps[shader], (const float*)&cb, 1, linear);
StretchRect(sTex, sr, dTex, dr, m_interlace.ps[shader], (const float*)&cb, 1, linear);
}
void GSDevice9::InitExternalFX()
@ -939,7 +939,7 @@ void GSDevice9::InitExternalFX()
}
}
void GSDevice9::DoExternalFX(GSTexture* st, GSTexture* dTex)
void GSDevice9::DoExternalFX(GSTexture* sTex, GSTexture* dTex)
{
GSVector2i s = dTex->GetSize();
@ -954,7 +954,7 @@ void GSDevice9::DoExternalFX(GSTexture* st, GSTexture* dTex)
cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f);
cb.rcpFrameOpt = GSVector4::zero();
StretchRect(st, sr, dTex, dr, m_shaderfx.ps, (const float*)&cb, 2, true);
StretchRect(sTex, sr, dTex, dr, m_shaderfx.ps, (const float*)&cb, 2, true);
}
void GSDevice9::InitFXAA()
@ -971,7 +971,7 @@ void GSDevice9::InitFXAA()
}
}
void GSDevice9::DoFXAA(GSTexture* st, GSTexture* dTex)
void GSDevice9::DoFXAA(GSTexture* sTex, GSTexture* dTex)
{
GSVector2i s = dTex->GetSize();
@ -985,10 +985,10 @@ void GSDevice9::DoFXAA(GSTexture* st, GSTexture* dTex)
cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f);
cb.rcpFrameOpt = GSVector4::zero();
StretchRect(st, sr, dTex, dr, m_fxaa.ps, (const float*)&cb, 2, true);
StretchRect(sTex, sr, dTex, dr, m_fxaa.ps, (const float*)&cb, 2, true);
}
void GSDevice9::DoShadeBoost(GSTexture* st, GSTexture* dTex)
void GSDevice9::DoShadeBoost(GSTexture* sTex, GSTexture* dTex)
{
GSVector2i s = dTex->GetSize();
@ -1000,7 +1000,7 @@ void GSDevice9::DoShadeBoost(GSTexture* st, GSTexture* dTex)
cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f);
cb.rcpFrameOpt = GSVector4::zero();
StretchRect(st, sr, dTex, dr, m_shadeboost.ps, (const float*)&cb, 1, true);
StretchRect(sTex, sr, dTex, dr, m_shadeboost.ps, (const float*)&cb, 1, true);
}
void GSDevice9::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vertices, bool datm)

View File

@ -74,11 +74,11 @@ class GSDevice9 : public GSDeviceDX
{
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
void DoMerge(GSTexture* st[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c);
void DoInterlace(GSTexture* st, GSTexture* dTex, int shader, bool linear, float yoffset = 0);
void DoFXAA(GSTexture* st, GSTexture* dTex);
void DoShadeBoost(GSTexture* st, GSTexture* dTex);
void DoExternalFX(GSTexture* st, GSTexture* dTex);
void DoMerge(GSTexture* sTex[2], GSVector4* sr, 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);
void DoExternalFX(GSTexture* sTex, GSTexture* dTex);
void InitExternalFX();
void InitFXAA();
@ -211,11 +211,11 @@ public:
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, int h, int format = 0);
void CopyRect(GSTexture* st, GSTexture* dTex, const GSVector4i& r);
void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r);
void StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true);
void StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, IDirect3DPixelShader9* ps, const float* ps_cb, int ps_cb_len, bool linear = true);
void StretchRect(GSTexture* st, 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& 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 IASetVertexBuffer(const void* vertex, size_t stride, size_t count);
bool IAMapVertexBuffer(void** vertex, size_t stride, size_t count);

View File

@ -29,8 +29,8 @@ class GSDeviceNull : public GSDevice
private:
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
void DoMerge(GSTexture* st[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c) {}
void DoInterlace(GSTexture* st, GSTexture* dTex, int shader, bool linear, float yoffset = 0) {}
void DoMerge(GSTexture* sTex[2], GSVector4* sr, 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:
GSDeviceNull() {}

View File

@ -702,11 +702,11 @@ GSTexture* GSDeviceOGL::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w
}
// Copy a sub part of a texture into another
void GSDeviceOGL::CopyRect(GSTexture* st, GSTexture* dTex, const GSVector4i& r)
void GSDeviceOGL::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r)
{
ASSERT(st && dTex);
ASSERT(sTex && dTex);
const GLuint& sid = st->GetID();
const GLuint& sid = sTex->GetID();
const GLuint& did = dTex->GetID();
#ifdef ENABLE_OGL_DEBUG
@ -733,25 +733,25 @@ void GSDeviceOGL::CopyRect(GSTexture* st, GSTexture* dTex, const GSVector4i& r)
GL_POP();
}
void GSDeviceOGL::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
{
StretchRect(st, sr, dTex, dr, m_convert.ps[shader], linear);
StretchRect(sTex, sr, dTex, dr, m_convert.ps[shader], linear);
}
void GSDeviceOGL::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, GLuint ps, bool linear)
void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, GLuint ps, bool linear)
{
StretchRect(st, sr, dTex, dr, ps, m_convert.bs, linear);
StretchRect(sTex, sr, dTex, dr, ps, m_convert.bs, linear);
}
void GSDeviceOGL::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, GLuint ps, GSBlendStateOGL* bs, bool linear)
void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, GLuint ps, GSBlendStateOGL* bs, bool linear)
{
if(!st || !dTex)
if(!sTex || !dTex)
{
ASSERT(0);
return;
}
GL_PUSH(format("StretchRect from %d to %d", st->GetID(), dTex->GetID()).c_str());
GL_PUSH(format("StretchRect from %d to %d", sTex->GetID(), dTex->GetID()).c_str());
// ************************************
// Init
@ -823,10 +823,10 @@ void GSDeviceOGL::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTe
// ************************************
if (GLLoader::found_GL_ARB_bindless_texture) {
GLuint64 handle[2] = {static_cast<GSTextureOGL*>(st)->GetHandle(linear ? m_convert.ln : m_convert.pt) , 0};
GLuint64 handle[2] = {static_cast<GSTextureOGL*>(sTex)->GetHandle(linear ? m_convert.ln : m_convert.pt) , 0};
m_shader->PS_ressources(handle);
} else {
PSSetShaderResource(0, st);
PSSetShaderResource(0, sTex);
PSSetSamplerState(linear ? m_convert.ln : m_convert.pt);
}
@ -844,7 +844,7 @@ void GSDeviceOGL::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTe
GL_POP();
}
void GSDeviceOGL::DoMerge(GSTexture* st[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
void GSDeviceOGL::DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
{
GL_PUSH("DoMerge");
@ -852,22 +852,22 @@ void GSDeviceOGL::DoMerge(GSTexture* st[2], GSVector4* sr, GSTexture* dTex, GSVe
ClearRenderTarget(dTex, c);
if(st[1] && !slbg)
if(sTex[1] && !slbg)
{
StretchRect(st[1], sr[1], dTex, dr[1], m_merge_obj.ps[0]);
StretchRect(sTex[1], sr[1], dTex, dr[1], m_merge_obj.ps[0]);
}
if(st[0])
if(sTex[0])
{
m_merge_obj.cb->upload(&c.v);
StretchRect(st[0], sr[0], dTex, dr[0], m_merge_obj.ps[mmod ? 1 : 0], m_merge_obj.bs);
StretchRect(sTex[0], sr[0], dTex, dr[0], m_merge_obj.ps[mmod ? 1 : 0], m_merge_obj.bs);
}
GL_POP();
}
void GSDeviceOGL::DoInterlace(GSTexture* st, GSTexture* dTex, int shader, bool linear, float yoffset)
void GSDeviceOGL::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset)
{
GL_PUSH("DoInterlace");
@ -885,12 +885,12 @@ void GSDeviceOGL::DoInterlace(GSTexture* st, GSTexture* dTex, int shader, bool l
m_interlace.cb->upload(&cb);
StretchRect(st, sr, dTex, dr, m_interlace.ps[shader], linear);
StretchRect(sTex, sr, dTex, dr, m_interlace.ps[shader], linear);
GL_POP();
}
void GSDeviceOGL::DoFXAA(GSTexture* st, GSTexture* dTex)
void GSDeviceOGL::DoFXAA(GSTexture* sTex, GSTexture* dTex)
{
// Lazy compile
if (!m_fxaa.ps) {
@ -912,12 +912,12 @@ void GSDeviceOGL::DoFXAA(GSTexture* st, GSTexture* dTex)
GSVector4 sr(0, 0, 1, 1);
GSVector4 dr(0, 0, s.x, s.y);
StretchRect(st, sr, dTex, dr, m_fxaa.ps, true);
StretchRect(sTex, sr, dTex, dr, m_fxaa.ps, true);
GL_POP();
}
void GSDeviceOGL::DoExternalFX(GSTexture* st, GSTexture* dTex)
void GSDeviceOGL::DoExternalFX(GSTexture* sTex, GSTexture* dTex)
{
// Lazy compile
if (!m_shaderfx.ps) {
@ -958,12 +958,12 @@ void GSDeviceOGL::DoExternalFX(GSTexture* st, GSTexture* dTex)
m_shaderfx.cb->upload(&cb);
StretchRect(st, sr, dTex, dr, m_shaderfx.ps, true);
StretchRect(sTex, sr, dTex, dr, m_shaderfx.ps, true);
GL_POP();
}
void GSDeviceOGL::DoShadeBoost(GSTexture* st, GSTexture* dTex)
void GSDeviceOGL::DoShadeBoost(GSTexture* sTex, GSTexture* dTex)
{
GL_PUSH("DoShadeBoost");
@ -981,7 +981,7 @@ void GSDeviceOGL::DoShadeBoost(GSTexture* st, GSTexture* dTex)
m_shadeboost.cb->upload(&cb);
StretchRect(st, sr, dTex, dr, m_shadeboost.ps, true);
StretchRect(sTex, sr, dTex, dr, m_shadeboost.ps, true);
GL_POP();
}

View File

@ -536,11 +536,11 @@ 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* st[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c);
void DoInterlace(GSTexture* st, GSTexture* dTex, int shader, bool linear, float yoffset = 0);
void DoFXAA(GSTexture* st, GSTexture* dTex);
void DoShadeBoost(GSTexture* st, GSTexture* dTex);
void DoExternalFX(GSTexture* st, GSTexture* dTex);
void DoMerge(GSTexture* sTex[2], GSVector4* sr, 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);
void DoExternalFX(GSTexture* sTex, GSTexture* dTex);
void OMAttachRt(GSTextureOGL* rt = NULL);
void OMAttachDs(GSTextureOGL* ds = NULL);
@ -587,10 +587,10 @@ class GSDeviceOGL : public GSDevice
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, int h, int format = 0);
void CopyRect(GSTexture* st, GSTexture* dTex, const GSVector4i& r);
void StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true);
void StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, GLuint ps, bool linear = true);
void StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, GLuint ps, GSBlendStateOGL* bs, bool linear = true);
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 SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vertices, bool datm);

View File

@ -102,15 +102,15 @@ GSTexture* GSDeviceSW::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w,
return dst;
}
void GSDeviceSW::CopyRect(GSTexture* st, GSTexture* dTex, const GSVector4i& r)
void GSDeviceSW::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r)
{
GSTexture::GSMap m;
if(st->Map(m, &r))
if(sTex->Map(m, &r))
{
dTex->Update(r, m.bits, m.pitch);
st->Unmap();
sTex->Unmap();
}
}
@ -207,7 +207,7 @@ public:
}
};
template<class SHADER> static void StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, const SHADER& shader, bool linear)
template<class SHADER> static void StretchRect(GSTexture* sTex, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, const SHADER& shader, bool linear)
{
GSVector4i r(dr.ceil());
@ -221,9 +221,9 @@ template<class SHADER> static void StretchRect(GSTexture* st, const GSVector4& s
GSTexture::GSMap sm;
if(!st->Map(sm, NULL)) {dTex->Unmap(); return;}
if(!sTex->Map(sm, NULL)) {dTex->Unmap(); return;}
GSVector2i ssize = st->GetSize();
GSVector2i ssize = sTex->GetSize();
GSVector4 p = dr;
GSVector4 t = sr * GSVector4(ssize).xyxy() * GSVector4((float)0x10000);
@ -297,34 +297,34 @@ template<class SHADER> static void StretchRect(GSTexture* st, const GSVector4& s
}
}
st->Unmap();
sTex->Unmap();
dTex->Unmap();
}
void GSDeviceSW::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader, bool linear)
void GSDeviceSW::StretchRect(GSTexture* sTex, const GSVector4& sr, 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() && st->GetSize() == dTex->GetSize())
if((sr == GSVector4(0, 0, 1, 1) & dr == GSVector4(dTex->GetSize()).zwxy()).alltrue() && sTex->GetSize() == dTex->GetSize())
{
// shortcut
CopyRect(st, dTex, GSVector4i(dTex->GetSize()).zwxy());
CopyRect(sTex, dTex, GSVector4i(dTex->GetSize()).zwxy());
return;
}
ShaderCopy s;
::StretchRect(st, sr, dTex, dr, s, linear);
::StretchRect(sTex, sr, dTex, dr, s, linear);
}
else if(shader == 1)
{
ShaderAlphaBlend s;
::StretchRect(st, sr, dTex, dr, s, linear);
::StretchRect(sTex, sr, dTex, dr, s, linear);
}
else
{
@ -349,24 +349,24 @@ void GSDeviceSW::OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVector
//
void GSDeviceSW::DoMerge(GSTexture* st[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
void GSDeviceSW::DoMerge(GSTexture* sTex[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c)
{
ClearRenderTarget(dTex, c);
if(st[1] && !slbg)
if(sTex[1] && !slbg)
{
StretchRect(st[1], sr[1], dTex, dr[1]);
StretchRect(sTex[1], sr[1], dTex, dr[1]);
}
if(st[0])
if(sTex[0])
{
if(mmod == 0)
{
// alpha = min(st[0].a * 2, 1)
// alpha = min(sTex[0].a * 2, 1)
ShaderAlpha2xBlend s;
::StretchRect(st[0], sr[0], dTex, dr[0], s, true);
::StretchRect(sTex[0], sr[0], dTex, dr[0], s, true);
}
else
{
@ -374,14 +374,14 @@ void GSDeviceSW::DoMerge(GSTexture* st[2], GSVector4* sr, GSTexture* dTex, GSVec
ShaderFactorBlend s((uint32)(int)(c.a * 255));
::StretchRect(st[0], sr[0], dTex, dr[0], s, true);
::StretchRect(sTex[0], sr[0], dTex, dr[0], s, true);
}
}
// dTex->Save("c:\\1.bmp");
}
void GSDeviceSW::DoInterlace(GSTexture* st, GSTexture* dTex, int shader, bool linear, float yoffset)
void GSDeviceSW::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset)
{
GSVector4 s = GSVector4(dTex->GetSize());
@ -398,7 +398,7 @@ void GSDeviceSW::DoInterlace(GSTexture* st, GSTexture* dTex, int shader, bool li
}
else if(shader == 3)
{
StretchRect(st, sr, dTex, dr, 0, linear);
StretchRect(sTex, sr, dTex, dr, 0, linear);
}
else
{

View File

@ -28,8 +28,8 @@ class GSDeviceSW : public GSDevice
{
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
void DoMerge(GSTexture* st[2], GSVector4* sr, GSTexture* dTex, GSVector4* dr, bool slbg, bool mmod, const GSVector4& c);
void DoInterlace(GSTexture* st, GSTexture* dTex, int shader, bool linear, float yoffset = 0);
void DoMerge(GSTexture* sTex[2], GSVector4* sr, 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);
@ -52,8 +52,8 @@ public:
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sr, int w, int h, int format = 0);
void CopyRect(GSTexture* st, GSTexture* dTex, const GSVector4i& r);
void StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dTex, const GSVector4& dr, int shader = 0, bool linear = true);
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 PSSetShaderResources(GSTexture* sr0, GSTexture* sr1);
void PSSetShaderResource(int i, GSTexture* sr);

View File

@ -876,9 +876,9 @@ void GSRasterizer::DrawEdge(const GSVertexSW& v0, const GSVertexSW& v1, const GS
if(orientation)
{
GSVector4 tbf = v0.p.yyyy(v1.p).ceil(); // t t b b
GSVector4 tbmax = tbf.max(m_fscissor_y); // max(t, st) max(t, sb) max(b, st) max(b, sb)
GSVector4 tbmin = tbf.min(m_fscissor_y); // min(t, st) min(t, sb) min(b, st) min(b, sb)
GSVector4i tb = GSVector4i(tbmax.xzyw(tbmin)); // max(t, st) max(b, sb) min(t, st) min(b, sb)
GSVector4 tbmax = tbf.max(m_fscissor_y); // max(t, sTex) max(t, sb) max(b, sTex) max(b, sb)
GSVector4 tbmin = tbf.min(m_fscissor_y); // min(t, sTex) min(t, sb) min(b, sTex) min(b, sb)
GSVector4i tb = GSVector4i(tbmax.xzyw(tbmin)); // max(t, sTex) max(b, sb) min(t, sTex) min(b, sb)
int top, bottom;
@ -886,7 +886,7 @@ void GSRasterizer::DrawEdge(const GSVertexSW& v0, const GSVertexSW& v1, const GS
if((dv.p >= GSVector4::zero()).mask() & 2)
{
top = tb.extract32<0>(); // max(t, st)
top = tb.extract32<0>(); // max(t, sTex)
bottom = tb.extract32<3>(); // min(b, sb)
if(top >= bottom) return;
@ -898,7 +898,7 @@ void GSRasterizer::DrawEdge(const GSVertexSW& v0, const GSVertexSW& v1, const GS
}
else
{
top = tb.extract32<1>(); // max(b, st)
top = tb.extract32<1>(); // max(b, sTex)
bottom = tb.extract32<2>(); // min(t, sb)
if(top >= bottom) return;

View File

@ -484,12 +484,12 @@ void GSState::GIFPackedRegHandlerRGBA(const GIFPackedReg* RESTRICT r)
void GSState::GIFPackedRegHandlerSTQ(const GIFPackedReg* RESTRICT r)
{
GSVector4i st = GSVector4i::loadl(&r->u64[0]);
GSVector4i sTex = GSVector4i::loadl(&r->u64[0]);
GSVector4i q = GSVector4i::loadl(&r->u64[1]);
GSVector4i::storel(&m_v.ST, st);
GSVector4i::storel(&m_v.ST, sTex);
q = q.blend8(GSVector4i::cast(GSVector4::m_one), q == GSVector4i::zero()); // character shadow in Vexx, q = 0 (st also 0 on the first 16 vertices), setting it to 1.0f to avoid div by zero later
q = q.blend8(GSVector4i::cast(GSVector4::m_one), q == GSVector4i::zero()); // character shadow in Vexx, q = 0 (sTex also 0 on the first 16 vertices), setting it to 1.0f to avoid div by zero later
*(int*)&m_q = GSVector4i::store(q);
@ -575,7 +575,7 @@ void GSState::GIFPackedRegHandlerSTQRGBAXYZF2(const GIFPackedReg* RESTRICT r, ui
while(r < r_end)
{
GSVector4i st = GSVector4i::loadl(&r[0].u64[0]);
GSVector4i sTex = GSVector4i::loadl(&r[0].u64[0]);
GSVector4i q = GSVector4i::loadl(&r[0].u64[1]);
GSVector4i rgba = (GSVector4i::load<false>(&r[1]) & GSVector4i::x000000ff()).ps32().pu16();
/*
@ -586,7 +586,7 @@ void GSState::GIFPackedRegHandlerSTQRGBAXYZF2(const GIFPackedReg* RESTRICT r, ui
*/
q = q.blend8(GSVector4i::cast(GSVector4::m_one), q == GSVector4i::zero()); // see GIFPackedRegHandlerSTQ
m_v.m[0] = st.upl64(rgba.upl32(q)); // TODO: only store the last one
m_v.m[0] = sTex.upl64(rgba.upl32(q)); // TODO: only store the last one
GSVector4i xy = GSVector4i::loadl(&r[2].u64[0]);
GSVector4i zf = GSVector4i::loadl(&r[2].u64[1]);
@ -612,7 +612,7 @@ void GSState::GIFPackedRegHandlerSTQRGBAXYZ2(const GIFPackedReg* RESTRICT r, uin
while(r < r_end)
{
GSVector4i st = GSVector4i::loadl(&r[0].u64[0]);
GSVector4i sTex = GSVector4i::loadl(&r[0].u64[0]);
GSVector4i q = GSVector4i::loadl(&r[0].u64[1]);
GSVector4i rgba = (GSVector4i::load<false>(&r[1]) & GSVector4i::x000000ff()).ps32().pu16();
/*
@ -623,7 +623,7 @@ void GSState::GIFPackedRegHandlerSTQRGBAXYZ2(const GIFPackedReg* RESTRICT r, uin
*/
q = q.blend8(GSVector4i::cast(GSVector4::m_one), q == GSVector4i::zero()); // see GIFPackedRegHandlerSTQ
m_v.m[0] = st.upl64(rgba.upl32(q)); // TODO: only store the last one
m_v.m[0] = sTex.upl64(rgba.upl32(q)); // TODO: only store the last one
GSVector4i xy = GSVector4i::loadl(&r[2].u64[0]);
GSVector4i z = GSVector4i::loadl(&r[2].u64[1]);
@ -2652,14 +2652,14 @@ void GSState::GetTextureMinMax(GSVector4i& r, const GIFRegTEX0& TEX0, const GIFR
if(wms != CLAMP_REGION_REPEAT || wmt != CLAMP_REGION_REPEAT)
{
GSVector4 st = m_vt.m_min.t.xyxy(m_vt.m_max.t);
GSVector4 sTex = m_vt.m_min.t.xyxy(m_vt.m_max.t);
if(linear)
{
st += GSVector4(-0.5f, 0.5f).xxyy();
sTex += GSVector4(-0.5f, 0.5f).xxyy();
}
GSVector4i uv = GSVector4i(st.floor());
GSVector4i uv = GSVector4i(sTex.floor());
GSVector4i u, v;

View File

@ -744,7 +744,7 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
GSVector4 sr(0, 0, w, h);
GSTexture* st = src->m_texture ? src->m_texture : dst->m_texture;
GSTexture* sTex = src->m_texture ? src->m_texture : dst->m_texture;
GSTexture* dTex = m_renderer->m_dev->CreateRenderTarget(w, h, false);
// GH: by default (m_paltex == 0) GSdx converts texture to the 32 bit format
// However it is different here. We want to reuse a Render Target as a texture.
@ -759,14 +759,14 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
if((sr == dr).alltrue())
{
m_renderer->m_dev->CopyRect(st, dTex, GSVector4i(0, 0, w, h));
m_renderer->m_dev->CopyRect(sTex, dTex, GSVector4i(0, 0, w, h));
}
else
{
sr.z /= st->GetWidth();
sr.w /= st->GetHeight();
sr.z /= sTex->GetWidth();
sr.w /= sTex->GetHeight();
m_renderer->m_dev->StretchRect(st, sr, dTex, dr);
m_renderer->m_dev->StretchRect(sTex, sr, dTex, dr);
}
if(dTex != src->m_texture)

View File

@ -179,10 +179,10 @@ void GSVertexTrace::FindMinMax(const void* vertex, const uint32* index, int coun
{
GSVector4i uv(v[index[i]].m[1]);
GSVector4 st = GSVector4(uv.uph16()).xyxy();
GSVector4 sTex = GSVector4(uv.uph16()).xyxy();
tmin = tmin.min(st);
tmax = tmax.max(st);
tmin = tmin.min(sTex);
tmax = tmax.max(sTex);
}
}