mirror of https://github.com/PCSX2/pcsx2.git
gsdx: extend CopyOffscreen with a new shader parameter
Currently we're trying to infer the conversion shader based on the output format It only works if the input data is RGBA8. It might not be true in the future
This commit is contained in:
parent
9554b5dd56
commit
1837001e75
|
@ -141,7 +141,7 @@ public:
|
|||
|
||||
virtual GSTexture* Resolve(GSTexture* t) {return NULL;}
|
||||
|
||||
virtual GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0) {return NULL;}
|
||||
virtual GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0, int ps_shader = 0) {return NULL;}
|
||||
|
||||
virtual void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r) {}
|
||||
virtual void StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, int shader = 0, bool linear = true) {}
|
||||
|
|
|
@ -565,7 +565,7 @@ GSTexture* GSDevice11::Resolve(GSTexture* t)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
GSTexture* GSDevice11::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format)
|
||||
GSTexture* GSDevice11::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format, int ps_shader)
|
||||
{
|
||||
GSTexture* dst = NULL;
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ public:
|
|||
|
||||
GSTexture* Resolve(GSTexture* t);
|
||||
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0);
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0, int ps_shader = 0);
|
||||
|
||||
void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r);
|
||||
|
||||
|
|
|
@ -768,7 +768,7 @@ GSTexture* GSDevice9::Resolve(GSTexture* t)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
GSTexture* GSDevice9::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format)
|
||||
GSTexture* GSDevice9::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format, int ps_shader)
|
||||
{
|
||||
GSTexture* dst = NULL;
|
||||
|
||||
|
|
|
@ -209,7 +209,7 @@ public:
|
|||
|
||||
GSTexture* Resolve(GSTexture* t);
|
||||
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0);
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0, int ps_shader = 0);
|
||||
|
||||
void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r);
|
||||
|
||||
|
|
|
@ -666,19 +666,19 @@ GSTexture* GSDeviceOGL::CreateOffscreen(int w, int h, int format)
|
|||
}
|
||||
|
||||
// blit a texture into an offscreen buffer
|
||||
GSTexture* GSDeviceOGL::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format)
|
||||
GSTexture* GSDeviceOGL::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format, int ps_shader)
|
||||
{
|
||||
if (format == 0)
|
||||
format = GL_RGBA8;
|
||||
|
||||
ASSERT(src);
|
||||
ASSERT(format == GL_RGBA8 || format == GL_R16UI);
|
||||
|
||||
if(format == 0) format = GL_RGBA8;
|
||||
|
||||
if(format != GL_RGBA8 && format != GL_R16UI) return NULL;
|
||||
|
||||
GSTexture* dst = CreateOffscreen(w, h, format);
|
||||
|
||||
GSVector4 dRect(0, 0, w, h);
|
||||
|
||||
StretchRect(src, sRect, dst, dRect, m_convert.ps[format == GL_R16UI ? 1 : 0]);
|
||||
StretchRect(src, sRect, dst, dRect, m_convert.ps[ps_shader]);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
|
@ -585,7 +585,7 @@ class GSDeviceOGL : public GSDevice
|
|||
void InitPrimDateTexture(GSTexture* rt);
|
||||
void RecycleDateTexture();
|
||||
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0);
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0, int ps_shader = 0);
|
||||
|
||||
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);
|
||||
|
|
|
@ -90,7 +90,7 @@ void GSDeviceSW::ClearStencil(GSTexture* t, uint8 c)
|
|||
Clear(t, c);
|
||||
}
|
||||
|
||||
GSTexture* GSDeviceSW::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format)
|
||||
GSTexture* GSDeviceSW::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format, int ps_shader)
|
||||
{
|
||||
GSTexture* dst = CreateOffscreen(w, h, format);
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
void ClearDepth(GSTexture* t, float c);
|
||||
void ClearStencil(GSTexture* t, uint8 c);
|
||||
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0);
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0, int ps_shader = 0);
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue