mirror of https://github.com/PCSX2/pcsx2.git
gsdx-ogl: allow to invalidate the texture
It just a hint to the driver to avoid any useless transfer I don't expect any change but it is free so why not ;)
This commit is contained in:
parent
75817bb27b
commit
757726bb91
|
@ -100,6 +100,7 @@ PFNGLGETSHADERINFOLOGPROC gl_GetShaderInfoLog = NU
|
||||||
PFNGLPROGRAMUNIFORM1IPROC gl_ProgramUniform1i = NULL;
|
PFNGLPROGRAMUNIFORM1IPROC gl_ProgramUniform1i = NULL;
|
||||||
// GL4.3
|
// GL4.3
|
||||||
PFNGLCOPYIMAGESUBDATAPROC gl_CopyImageSubData = NULL;
|
PFNGLCOPYIMAGESUBDATAPROC gl_CopyImageSubData = NULL;
|
||||||
|
PFNGLINVALIDATETEXIMAGEPROC gl_InvalidateTexImage = NULL;
|
||||||
// GL4.2
|
// GL4.2
|
||||||
PFNGLBINDIMAGETEXTUREPROC gl_BindImageTexture = NULL;
|
PFNGLBINDIMAGETEXTUREPROC gl_BindImageTexture = NULL;
|
||||||
PFNGLMEMORYBARRIERPROC gl_MemoryBarrier = NULL;
|
PFNGLMEMORYBARRIERPROC gl_MemoryBarrier = NULL;
|
||||||
|
|
|
@ -292,6 +292,7 @@ extern PFNGLMEMORYBARRIERPROC gl_MemoryBarrier;
|
||||||
extern PFNGLTEXSTORAGE2DPROC gl_TexStorage2D;
|
extern PFNGLTEXSTORAGE2DPROC gl_TexStorage2D;
|
||||||
// GL4.3
|
// GL4.3
|
||||||
extern PFNGLCOPYIMAGESUBDATAPROC gl_CopyImageSubData;
|
extern PFNGLCOPYIMAGESUBDATAPROC gl_CopyImageSubData;
|
||||||
|
extern PFNGLINVALIDATETEXIMAGEPROC gl_InvalidateTexImage;
|
||||||
// GL4.4
|
// GL4.4
|
||||||
extern PFNGLBUFFERSTORAGEPROC gl_BufferStorage;
|
extern PFNGLBUFFERSTORAGEPROC gl_BufferStorage;
|
||||||
// GL_ARB_bindless_texture (GL5?)
|
// GL_ARB_bindless_texture (GL5?)
|
||||||
|
|
|
@ -154,6 +154,8 @@ void GSDevice::Recycle(GSTexture* t)
|
||||||
{
|
{
|
||||||
if(t)
|
if(t)
|
||||||
{
|
{
|
||||||
|
Invalidate(t);
|
||||||
|
|
||||||
t->last_frame_used = m_frame;
|
t->last_frame_used = m_frame;
|
||||||
|
|
||||||
m_pool.push_front(t);
|
m_pool.push_front(t);
|
||||||
|
|
|
@ -111,6 +111,7 @@ public:
|
||||||
virtual ~GSDevice();
|
virtual ~GSDevice();
|
||||||
|
|
||||||
void Recycle(GSTexture* t);
|
void Recycle(GSTexture* t);
|
||||||
|
virtual void Invalidate(GSTexture* t) {}
|
||||||
|
|
||||||
enum {Windowed, Fullscreen, DontCare};
|
enum {Windowed, Fullscreen, DontCare};
|
||||||
|
|
||||||
|
|
|
@ -603,6 +603,12 @@ void GSDeviceOGL::Barrier(GLbitfield b)
|
||||||
#endif
|
#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 */
|
/* Note: must be here because tfx_glsl is static */
|
||||||
GLuint GSDeviceOGL::CompileVS(VSSelector sel, int logz)
|
GLuint GSDeviceOGL::CompileVS(VSSelector sel, int logz)
|
||||||
{
|
{
|
||||||
|
|
|
@ -600,6 +600,8 @@ class GSDeviceOGL : public GSDevice
|
||||||
void BeforeDraw();
|
void BeforeDraw();
|
||||||
void AfterDraw();
|
void AfterDraw();
|
||||||
|
|
||||||
|
void Invalidate(GSTexture* t);
|
||||||
|
|
||||||
void ClearRenderTarget(GSTexture* t, const GSVector4& c);
|
void ClearRenderTarget(GSTexture* t, const GSVector4& c);
|
||||||
void ClearRenderTarget(GSTexture* t, uint32 c);
|
void ClearRenderTarget(GSTexture* t, uint32 c);
|
||||||
void ClearRenderTarget_ui(GSTexture* t, uint32 c);
|
void ClearRenderTarget_ui(GSTexture* t, uint32 c);
|
||||||
|
|
|
@ -107,6 +107,7 @@ void GSWndGL::PopulateGlFunction()
|
||||||
*(void**)&(gl_TexStorage2D) = GetProcAddress("glTexStorage2D");
|
*(void**)&(gl_TexStorage2D) = GetProcAddress("glTexStorage2D");
|
||||||
// GL4.3
|
// GL4.3
|
||||||
*(void**)&(gl_CopyImageSubData) = GetProcAddress("glCopyImageSubData", true);
|
*(void**)&(gl_CopyImageSubData) = GetProcAddress("glCopyImageSubData", true);
|
||||||
|
*(void**)&(gl_InvalidateTexImage) = GetProcAddress("glInvalidateTexImage", true);
|
||||||
// GL4.4
|
// GL4.4
|
||||||
*(void**)&(gl_BufferStorage) = GetProcAddress("glBufferStorage", true);
|
*(void**)&(gl_BufferStorage) = GetProcAddress("glBufferStorage", true);
|
||||||
// GL_ARB_bindless_texture (GL5?)
|
// GL_ARB_bindless_texture (GL5?)
|
||||||
|
|
Loading…
Reference in New Issue