* don't delete the wnd in GSclose. It can still be used later
* Properly detect the GL_ARB_gpu_shader5 extension for Fxaa
* A couple of fix in Create (GSopen1) of GSWndEGL/GSWndOGL


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5674 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2013-06-16 16:33:08 +00:00
parent b7a6dd93b3
commit f4ce6d6fce
7 changed files with 21 additions and 10 deletions

View File

@ -105,6 +105,7 @@ namespace GLLoader {
bool found_GL_NV_copy_image = false;
bool found_GL_ARB_copy_image = false;
bool found_only_gl30 = false;
bool found_GL_ARB_gpu_shader5 = false;
bool check_gl_version(uint32 major, uint32 minor) {
@ -165,19 +166,23 @@ namespace GLLoader {
if (ext.compare("GL_NV_copy_image") == 0) found_GL_NV_copy_image = true;
// Replace previous extensions (when driver will be updated)
if (ext.compare("GL_ARB_copy_image") == 0) found_GL_ARB_copy_image = true;
if (ext.compare("GL_ARB_gpu_shader5") == 0) found_GL_ARB_gpu_shader5 = true;
}
}
if (!found_GL_ARB_separate_shader_objects) {
fprintf(stderr, "GL_ARB_separate_shader_objects is not supported\n");
fprintf(stderr, "INFO: GL_ARB_separate_shader_objects is not supported\n");
}
if (!found_GL_ARB_shading_language_420pack) {
fprintf(stderr, "GL_ARB_shading_language_420pack is not supported\n");
fprintf(stderr, "INFO: GL_ARB_shading_language_420pack is not supported\n");
}
if (!found_GL_ARB_texture_storage) {
fprintf(stderr, "GL_ARB_texture_storage is not supported\n");
fprintf(stderr, "FATAL: GL_ARB_texture_storage is not supported\n");
return false;
}
if (!found_GL_ARB_gpu_shader5) {
fprintf(stderr, "INFO: GL_ARB_gpu_shader5 is not supported\n");
}
if (theApp.GetConfig("override_GL_ARB_shading_language_420pack", -1) != -1) {

View File

@ -107,4 +107,5 @@ namespace GLLoader {
extern bool found_geometry_shader;
extern bool fglrx_buggy_driver;
extern bool found_only_gl30;
extern bool found_GL_ARB_gpu_shader5;
}

View File

@ -182,10 +182,6 @@ EXPORT_C GSclose()
if (s_gs->m_wnd)
{
s_gs->m_wnd->Detach();
delete s_gs->m_wnd;
s_gs->m_wnd = NULL;
}
}
@ -333,6 +329,7 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
}
catch (GSDXRecoverableError)
{
wnd[i]->Detach();
delete wnd[i];
}
}
@ -1441,6 +1438,7 @@ EXPORT_C GSReplay(char* lpszCmdLine, int renderer)
void* hWnd = NULL;
_GSopen((void**)&hWnd, "", renderer);
if (s_gs->m_wnd == NULL) return;
uint32 crc;
fread(&crc, 4, 1, fp);

View File

@ -318,7 +318,7 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
// FIXME need to manually set the index...
// FIXME need dofxaa interface too
std::string fxaa_macro = "#define FXAA_GLSL_130 1\n";
if (!GLLoader::found_only_gl30) {
if (GLLoader::found_GL_ARB_gpu_shader5) {
// This extension become core on openGL4
fxaa_macro += "#extension GL_ARB_gpu_shader5 : enable\n";
fxaa_macro += "#define FXAA_GATHER4_ALPHA 1\n";

View File

@ -52,6 +52,11 @@ GSRenderer::~GSRenderer()
}*/
delete m_dev;
if (m_wnd)
{
delete m_wnd;
}
}
bool GSRenderer::CreateWnd(const string& title, int w, int h)

View File

@ -169,7 +169,9 @@ bool GSWndEGL::Create(const string& title, int w, int h)
CheckContext();
if (m_NativeWindow != 0)
PopulateGlFunction();
if (m_NativeWindow == 0)
throw GSDXRecoverableError();
return true;

View File

@ -190,7 +190,7 @@ bool GSWndOGL::Create(const string& title, int w, int h)
PopulateGlFunction();
if (m_NativeWindow != 0)
if (m_NativeWindow == 0)
throw GSDXRecoverableError();
return true;