gsdx-ogl: bump base requirement to 3.3

A couple of fallbacks were introduced for the Mesa driver that only support 3.0
DSA will require a recent Mesa which already support GL3.3

Require at least SandyBridge for Intel GPU
This commit is contained in:
Gregory Hainaut 2014-09-30 22:04:42 +02:00
parent 594f6c33a2
commit f46e8cc6ac
5 changed files with 8 additions and 31 deletions

View File

@ -160,8 +160,7 @@ namespace GLLoader {
// Optional
bool found_GL_ARB_separate_shader_objects = false;
bool found_geometry_shader = true;
bool found_only_gl30 = false; // Drop it when mesa support GLSL330
bool found_geometry_shader = true; // we require GL3.3 so geometry must be supported by default
bool found_GL_ARB_clear_texture = false; // Don't know if GL3 GPU can support it
bool found_GL_ARB_buffer_storage = false;
bool found_GL_ARB_explicit_uniform_location = false; // need by subroutine
@ -238,10 +237,6 @@ namespace GLLoader {
GLuint minor_gl = s[dot+1]-'0';
#ifndef ENABLE_GLES
if ( (major_gl < 3) || ( major_gl == 3 && minor_gl < 2 ) ) {
fprintf(stderr, "Geometry shaders are not supported. Required openGL 3.2\n");
found_geometry_shader = false;
}
if (mesa_amd_buggy_driver || intel_buggy_driver) {
fprintf(stderr, "Buggy driver detected. Geometry shaders will be disabled\n");
found_geometry_shader = false;
@ -250,10 +245,6 @@ namespace GLLoader {
found_geometry_shader = !!theApp.GetConfig("override_geometry_shader", -1);
fprintf(stderr, "Override geometry shaders detection\n");
}
if ( (major_gl == 3) && minor_gl < 3) {
// Opensource driver spotted
found_only_gl30 = true;
}
#else
found_geometry_shader = false;
#endif

View File

@ -425,7 +425,6 @@ namespace GLLoader {
extern bool found_GL_ARB_shading_language_420pack;
extern bool found_GL_ARB_copy_image;
extern bool found_geometry_shader;
extern bool found_only_gl30;
extern bool found_GL_ARB_gpu_shader5;
extern bool found_GL_ARB_shader_image_load_store;
extern bool found_GL_ARB_clear_texture;

View File

@ -161,7 +161,7 @@ GSTexture* GSDeviceOGL::FetchSurface(int type, int w, int h, bool msaa, int form
bool GSDeviceOGL::Create(GSWnd* wnd)
{
if (m_window == NULL) {
if (!GLLoader::check_gl_version(3, 0)) return false;
if (!GLLoader::check_gl_version(3, 3)) return false;
if (!GLLoader::check_gl_supported_extension()) return false;
}

View File

@ -355,11 +355,7 @@ std::string GSShaderOGL::GenGlslHeader(const std::string& entry, GLenum type, co
{
std::string header;
#ifndef ENABLE_GLES
if (GLLoader::found_only_gl30) {
header = "#version 130\n";
} else {
header = "#version 330 core\n";
}
header = "#version 330 core\n";
if (GLLoader::found_GL_ARB_shading_language_420pack) {
// Need GL version 420
header += "#extension GL_ARB_shading_language_420pack: require\n";
@ -370,12 +366,6 @@ std::string GSShaderOGL::GenGlslHeader(const std::string& entry, GLenum type, co
// Need GL version 410
header += "#extension GL_ARB_separate_shader_objects: require\n";
}
if (GLLoader::found_only_gl30) {
// Need version 330
header += "#extension GL_ARB_explicit_attrib_location: require\n";
// Need version 140
header += "#extension GL_ARB_uniform_buffer_object: require\n";
}
if (GLLoader::found_GL_ARB_shader_subroutine && GLLoader::found_GL_ARB_explicit_uniform_location) {
// Need GL version 400
header += "#define SUBROUTINE_GL40 1\n";
@ -385,9 +375,6 @@ std::string GSShaderOGL::GenGlslHeader(const std::string& entry, GLenum type, co
// Need GL version 430
header += "#extension GL_ARB_explicit_uniform_location: require\n";
}
#ifdef ENABLE_OGL_STENCIL_DEBUG
header += "#define ENABLE_OGL_STENCIL_DEBUG 1\n";
#endif
if (GLLoader::found_GL_ARB_shader_image_load_store) {
// Need GL version 420
header += "#extension GL_ARB_shader_image_load_store: require\n";
@ -395,13 +382,16 @@ std::string GSShaderOGL::GenGlslHeader(const std::string& entry, GLenum type, co
header += "#define DISABLE_GL42_image\n";
}
if (GLLoader::found_GL_ARB_bindless_texture && GLLoader::found_GL_ARB_explicit_uniform_location) {
// Future opengl 5?
// ARB extension (4.4)
header += "#extension GL_ARB_bindless_texture: require\n";
header += "#define ENABLE_BINDLESS_TEX\n";
}
if (GLLoader::found_GL_ARB_clip_control) {
header += "#define ZERO_TO_ONE_DEPTH\n";
}
#ifdef ENABLE_OGL_STENCIL_DEBUG
header += "#define ENABLE_OGL_STENCIL_DEBUG 1\n";
#endif
#else // ENABLE_GLES
header = "#version 310 es\n";
header += "#extension GL_EXT_shader_io_blocks: require\n";

View File

@ -138,10 +138,7 @@ bool GSWndOGL::Attach(void* handle, bool managed)
m_NativeDisplay = XOpenDisplay(NULL);
if (theApp.GetConfig("reduce_gl_requirement_for_free_driver", 0) == 1)
CreateContext(3, 0);
else
CreateContext(3, 3);
CreateContext(3, 3);
AttachContext();