mirror of https://github.com/PCSX2/pcsx2.git
gsdx ogl:
* fix shader compilation on Nvidia (broken on r5682) * fix various memory leak thanks to Valgrind Cmake: fix a minor typo git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5688 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
58cacc3b1c
commit
d81254469a
|
@ -122,6 +122,15 @@ GSDeviceOGL::~GSDeviceOGL()
|
||||||
delete m_date.dss;
|
delete m_date.dss;
|
||||||
delete m_date.bs;
|
delete m_date.bs;
|
||||||
|
|
||||||
|
// Clean shadeboost
|
||||||
|
delete m_shadeboost.cb;
|
||||||
|
if (GLLoader::found_GL_ARB_separate_shader_objects) {
|
||||||
|
gl_DeleteProgram(m_shadeboost.ps);
|
||||||
|
} else {
|
||||||
|
gl_DeleteShader(m_shadeboost.ps);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Clean various opengl allocation
|
// Clean various opengl allocation
|
||||||
if (GLLoader::found_GL_ARB_separate_shader_objects)
|
if (GLLoader::found_GL_ARB_separate_shader_objects)
|
||||||
gl_DeleteProgramPipelines(1, &m_pipeline);
|
gl_DeleteProgramPipelines(1, &m_pipeline);
|
||||||
|
@ -134,6 +143,7 @@ GSDeviceOGL::~GSDeviceOGL()
|
||||||
gl_DeleteSamplers(1, &m_palette_ss);
|
gl_DeleteSamplers(1, &m_palette_ss);
|
||||||
delete m_vb;
|
delete m_vb;
|
||||||
|
|
||||||
|
|
||||||
if (GLLoader::found_GL_ARB_separate_shader_objects) {
|
if (GLLoader::found_GL_ARB_separate_shader_objects) {
|
||||||
for (uint32 key = 0; key < VSSelector::size(); key++) gl_DeleteProgram(m_vs[key]);
|
for (uint32 key = 0; key < VSSelector::size(); key++) gl_DeleteProgram(m_vs[key]);
|
||||||
for (uint32 key = 0; key < GSSelector::size(); key++) gl_DeleteProgram(m_gs[key]);
|
for (uint32 key = 0; key < GSSelector::size(); key++) gl_DeleteProgram(m_gs[key]);
|
||||||
|
@ -146,11 +156,13 @@ GSDeviceOGL::~GSDeviceOGL()
|
||||||
for (auto it = m_single_prog.begin(); it != m_single_prog.end() ; it++) gl_DeleteProgram(it->second);
|
for (auto it = m_single_prog.begin(); it != m_single_prog.end() ; it++) gl_DeleteProgram(it->second);
|
||||||
m_single_prog.clear();
|
m_single_prog.clear();
|
||||||
}
|
}
|
||||||
|
m_ps.clear();
|
||||||
|
|
||||||
gl_DeleteSamplers(PSSamplerSelector::size(), m_ps_ss);
|
gl_DeleteSamplers(PSSamplerSelector::size(), m_ps_ss);
|
||||||
|
|
||||||
for (uint32 key = 0; key < OMDepthStencilSelector::size(); key++) delete m_om_dss[key];
|
for (uint32 key = 0; key < OMDepthStencilSelector::size(); key++) delete m_om_dss[key];
|
||||||
m_ps.clear();
|
|
||||||
|
for (auto it = m_om_bs.begin(); it != m_om_bs.end(); it++) delete it->second;
|
||||||
m_om_bs.clear();
|
m_om_bs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1417,6 +1429,8 @@ void GSDeviceOGL::CheckDebugLog()
|
||||||
pos += lengths[i];
|
pos += lengths[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete[] messageLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GSDeviceOGL::DebugOutputToFile(unsigned int source, unsigned int type, unsigned int id, unsigned int severity, const char* message)
|
void GSDeviceOGL::DebugOutputToFile(unsigned int source, unsigned int type, unsigned int id, unsigned int severity, const char* message)
|
||||||
|
|
|
@ -136,6 +136,10 @@ void GSWndEGL::Detach()
|
||||||
// Actually the destructor is not called when there is only a GSclose/GSshutdown
|
// Actually the destructor is not called when there is only a GSclose/GSshutdown
|
||||||
// The window still need to be closed
|
// The window still need to be closed
|
||||||
DetachContext();
|
DetachContext();
|
||||||
|
eglDestroyContext(m_eglDisplay, m_eglContext);
|
||||||
|
m_eglContext = NULL;
|
||||||
|
eglDestroySurface(m_eglDisplay, m_eglSurface);
|
||||||
|
m_eglSurface = NULL;
|
||||||
CloseEGLDisplay();
|
CloseEGLDisplay();
|
||||||
|
|
||||||
if (m_NativeDisplay) {
|
if (m_NativeDisplay) {
|
||||||
|
|
|
@ -63,6 +63,8 @@ void GSWndOGL::CreateContext(int major, int minor)
|
||||||
if (!fbc || fbcount < 1) {
|
if (!fbc || fbcount < 1) {
|
||||||
throw GSDXRecoverableError();
|
throw GSDXRecoverableError();
|
||||||
}
|
}
|
||||||
|
XFree(fbc);
|
||||||
|
GLXFBConfig fbc_cp = fbc[0];
|
||||||
|
|
||||||
PFNGLXCREATECONTEXTATTRIBSARBPROC glX_CreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress((const GLubyte*) "glXCreateContextAttribsARB");
|
PFNGLXCREATECONTEXTATTRIBSARBPROC glX_CreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress((const GLubyte*) "glXCreateContextAttribsARB");
|
||||||
if (!glX_CreateContextAttribsARB) {
|
if (!glX_CreateContextAttribsARB) {
|
||||||
|
@ -86,7 +88,7 @@ void GSWndOGL::CreateContext(int major, int minor)
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
m_context = glX_CreateContextAttribsARB(m_NativeDisplay, fbc[0], 0, true, context_attribs);
|
m_context = glX_CreateContextAttribsARB(m_NativeDisplay, fbc_cp, 0, true, context_attribs);
|
||||||
|
|
||||||
// Don't forget to reinstall the older Handler
|
// Don't forget to reinstall the older Handler
|
||||||
XSetErrorHandler(oldHandler);
|
XSetErrorHandler(oldHandler);
|
||||||
|
|
|
@ -100,7 +100,7 @@ layout(std140, binding = 20) uniform cb20
|
||||||
vec2 TextureScale;
|
vec2 TextureScale;
|
||||||
};
|
};
|
||||||
|
|
||||||
const float exp_min32 = exp2(-32);
|
const float exp_min32 = exp2(-32.0f);
|
||||||
|
|
||||||
void vs_main()
|
void vs_main()
|
||||||
{
|
{
|
||||||
|
|
|
@ -128,7 +128,7 @@ static const char* tfx_glsl =
|
||||||
" vec2 TextureScale;\n"
|
" vec2 TextureScale;\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
"\n"
|
"\n"
|
||||||
"const float exp_min32 = exp2(-32);\n"
|
"const float exp_min32 = exp2(-32.0f);\n"
|
||||||
"\n"
|
"\n"
|
||||||
"void vs_main()\n"
|
"void vs_main()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
|
|
@ -110,7 +110,7 @@ add_library(${Output} SHARED
|
||||||
|
|
||||||
|
|
||||||
# link target with project internal libraries
|
# link target with project internal libraries
|
||||||
target_link_libraries(${Output} Utilities Utilities)
|
target_link_libraries(${Output} Utilities)
|
||||||
|
|
||||||
# link target with ALSA
|
# link target with ALSA
|
||||||
target_link_libraries(${Output} ${ALSA_LIBRARIES})
|
target_link_libraries(${Output} ${ALSA_LIBRARIES})
|
||||||
|
|
Loading…
Reference in New Issue