mirror of https://github.com/PCSX2/pcsx2.git
gsdx: move invalidation from GSDevice to GSTexture
Much cleaner this way
This commit is contained in:
parent
2bd9043657
commit
ee19a2789c
|
@ -154,7 +154,7 @@ void GSDevice::Recycle(GSTexture* t)
|
|||
{
|
||||
if(t)
|
||||
{
|
||||
Invalidate(t);
|
||||
t->Invalidate();
|
||||
|
||||
t->last_frame_used = m_frame;
|
||||
|
||||
|
|
|
@ -111,7 +111,6 @@ public:
|
|||
virtual ~GSDevice();
|
||||
|
||||
void Recycle(GSTexture* t);
|
||||
virtual void Invalidate(GSTexture* t) {}
|
||||
|
||||
enum {Windowed, Fullscreen, DontCare};
|
||||
|
||||
|
|
|
@ -607,12 +607,6 @@ void GSDeviceOGL::Barrier(GLbitfield b)
|
|||
#endif
|
||||
}
|
||||
|
||||
void GSDeviceOGL::Invalidate(GSTexture* t)
|
||||
{
|
||||
if (gl_InvalidateTexImage)
|
||||
gl_InvalidateTexImage(static_cast<GSTextureOGL*>(t)->GetID(), GL_TEX_LEVEL_0);
|
||||
}
|
||||
|
||||
/* Note: must be here because tfx_glsl is static */
|
||||
GLuint GSDeviceOGL::CompileVS(VSSelector sel, int logz)
|
||||
{
|
||||
|
|
|
@ -601,8 +601,6 @@ class GSDeviceOGL : public GSDevice
|
|||
void BeforeDraw();
|
||||
void AfterDraw();
|
||||
|
||||
void Invalidate(GSTexture* t);
|
||||
|
||||
void ClearRenderTarget(GSTexture* t, const GSVector4& c);
|
||||
void ClearRenderTarget(GSTexture* t, uint32 c);
|
||||
void ClearRenderTarget_ui(GSTexture* t, uint32 c);
|
||||
|
|
|
@ -47,6 +47,7 @@ public:
|
|||
virtual bool Map(GSMap& m, const GSVector4i* r = NULL) = 0;
|
||||
virtual void Unmap() = 0;
|
||||
virtual bool Save(const string& fn, bool dds = false) = 0;
|
||||
virtual void Invalidate() {};
|
||||
|
||||
GSVector2 GetScale() const {return m_scale;}
|
||||
void SetScale(const GSVector2& scale) {m_scale = scale;}
|
||||
|
|
|
@ -165,8 +165,7 @@ namespace PboPool {
|
|||
// glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
GSTextureOGL::GSTextureOGL(int type, int w, int h, int format, GLuint fbo_read)
|
||||
: m_pbo_id(0),
|
||||
m_pbo_size(0)
|
||||
: m_pbo_id(0), m_pbo_size(0), m_dirty(false)
|
||||
{
|
||||
// m_size.x = w;
|
||||
// m_size.y = h;
|
||||
|
@ -273,9 +272,16 @@ GSTextureOGL::~GSTextureOGL()
|
|||
glDeleteTextures(1, &m_texture_id);
|
||||
}
|
||||
|
||||
void GSTextureOGL::Invalidate()
|
||||
{
|
||||
if (m_dirty && gl_InvalidateTexImage)
|
||||
gl_InvalidateTexImage(m_texture_id, GL_TEX_LEVEL_0);
|
||||
}
|
||||
|
||||
bool GSTextureOGL::Update(const GSVector4i& r, const void* data, int pitch)
|
||||
{
|
||||
ASSERT(m_type != GSTexture::DepthStencil && m_type != GSTexture::Offscreen);
|
||||
m_dirty = true;
|
||||
|
||||
// Note: reduce noise for gl retracers
|
||||
// It might introduce bug after an emulator pause so always set it in standard mode
|
||||
|
|
|
@ -49,6 +49,7 @@ class GSTextureOGL : public GSTexture
|
|||
uint32 m_pbo_id;
|
||||
int m_pbo_size;
|
||||
GLuint m_fbo_read;
|
||||
bool m_dirty;
|
||||
|
||||
// internal opengl format/type/alignment
|
||||
GLenum m_int_format;
|
||||
|
@ -62,6 +63,7 @@ class GSTextureOGL : public GSTexture
|
|||
explicit GSTextureOGL(int type, int w, int h, int format, GLuint fbo_read);
|
||||
virtual ~GSTextureOGL();
|
||||
|
||||
void Invalidate();
|
||||
bool Update(const GSVector4i& r, const void* data, int pitch);
|
||||
bool Map(GSMap& m, const GSVector4i* r = NULL);
|
||||
void Unmap();
|
||||
|
|
Loading…
Reference in New Issue