gsdx-ogl: code seems compatible with an opengl 3.3 context. Only load some shader extensions.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5041 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2012-01-03 17:17:04 +00:00
parent cc6e486742
commit 76542f89c9
2 changed files with 17 additions and 5 deletions

View File

@ -203,8 +203,20 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
// Note: 4.2 crash on latest nvidia drivers!
// So only check 4.1
// if ( (major < 4) || ( major == 4 && minor < 2 ) ) return false;
if ( (major < 4) || ( major == 4 && minor < 1 ) ) return false;
// if ( (major < 4) || ( major == 4 && minor < 1 ) ) return false;
if ( (major < 3) || ( major == 3 && minor < 3 ) ) {
fprintf(stderr, "OPENGL 3.3 is not supported\n");
return false;
}
if ( !glewIsSupported("GL_ARB_separate_shader_objects")) {
fprintf(stderr, "GL_ARB_separate_shader_objects is not supported\n");
return false;
}
if ( !glewIsSupported("GL_ARB_shading_language_420pack")) {
fprintf(stderr, "GL_ARB_shading_language_420pack is not supported\n");
return false;
}
}
@ -1164,8 +1176,8 @@ void GSDeviceOGL::CompileShaderFromSource(const std::string& glsl_file, const st
// Build a header string
// *****************************************************
// First select the version (must be the first line so we need to generate it
//std::string version = "#version 410\n#extension GL_ARB_shading_language_420pack: enable\n";
std::string version = "#version 420\n";
std::string version = "#version 330\n#extension GL_ARB_shading_language_420pack: enable\n#extension GL_ARB_separate_shader_objects : enable\n";
//std::string version = "#version 420\n";
// Allow to puts several shader in 1 files
std::string shader_type;

View File

@ -369,9 +369,9 @@ bool GSWnd::Attach(void* handle, bool managed)
// Create a context
int context_attribs[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 4,
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
// Note: 4.2 crash on latest nvidia drivers!
GLX_CONTEXT_MINOR_VERSION_ARB, 1,
GLX_CONTEXT_MINOR_VERSION_ARB, 3,
// FIXME : Request a debug context to ease opengl development
// Note: don't support deprecated feature (pre openg 3.1)
//GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,