diff --git a/plugins/GSdx/GSShaderOGL.cpp b/plugins/GSdx/GSShaderOGL.cpp index c57d0d73d0..2a7f9ae831 100644 --- a/plugins/GSdx/GSShaderOGL.cpp +++ b/plugins/GSdx/GSShaderOGL.cpp @@ -218,6 +218,8 @@ std::string GSShaderOGL::GenGlslHeader(const std::string& entry, GLenum type, co } else { header += "#define DISABLE_GL42_image\n"; } + if (GLLoader::fglrx_buggy_driver || GLLoader::intel_buggy_driver) + header += "#define BROKEN_DRIVER as_usual\n"; // Stupid GL implementation (can't use GL_ES) // AMD/nvidia define it to 0 diff --git a/plugins/GSdx/res/glsl/tfx_fs.glsl b/plugins/GSdx/res/glsl/tfx_fs.glsl index 2a93599f87..ec4c2bd0d0 100644 --- a/plugins/GSdx/res/glsl/tfx_fs.glsl +++ b/plugins/GSdx/res/glsl/tfx_fs.glsl @@ -26,7 +26,7 @@ #ifdef FRAGMENT_SHADER -#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts +#if !defined(BROKEN_DRIVER) && defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts layout(location = 0) #endif in SHADER diff --git a/plugins/GSdx/res/glsl/tfx_vgs.glsl b/plugins/GSdx/res/glsl/tfx_vgs.glsl index d83ee6ff84..fbfdaa222b 100644 --- a/plugins/GSdx/res/glsl/tfx_vgs.glsl +++ b/plugins/GSdx/res/glsl/tfx_vgs.glsl @@ -9,7 +9,7 @@ layout(location = 5) in uint i_z; layout(location = 6) in uvec2 i_uv; layout(location = 7) in vec4 i_f; -#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts +#if !defined(BROKEN_DRIVER) && defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts layout(location = 0) #endif out SHADER @@ -64,7 +64,7 @@ void vs_main() #ifdef GEOMETRY_SHADER -#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts +#if !defined(BROKEN_DRIVER) && defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts layout(location = 0) #endif in SHADER @@ -75,7 +75,7 @@ in SHADER flat vec4 fc; } GSin[]; -#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts +#if !defined(BROKEN_DRIVER) && defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts layout(location = 0) #endif out SHADER diff --git a/plugins/GSdx/res/glsl_source.h b/plugins/GSdx/res/glsl_source.h index d075a3a6b9..5fc14714c0 100644 --- a/plugins/GSdx/res/glsl_source.h +++ b/plugins/GSdx/res/glsl_source.h @@ -749,7 +749,7 @@ static const char* const tfx_vgs_glsl = "layout(location = 6) in uvec2 i_uv;\n" "layout(location = 7) in vec4 i_f;\n" "\n" - "#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts\n" + "#if !defined(BROKEN_DRIVER) && defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts\n" "layout(location = 0)\n" "#endif\n" "out SHADER\n" @@ -804,7 +804,7 @@ static const char* const tfx_vgs_glsl = "\n" "#ifdef GEOMETRY_SHADER\n" "\n" - "#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts\n" + "#if !defined(BROKEN_DRIVER) && defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts\n" "layout(location = 0)\n" "#endif\n" "in SHADER\n" @@ -815,7 +815,7 @@ static const char* const tfx_vgs_glsl = " flat vec4 fc;\n" "} GSin[];\n" "\n" - "#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts\n" + "#if !defined(BROKEN_DRIVER) && defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts\n" "layout(location = 0)\n" "#endif\n" "out SHADER\n" @@ -1025,7 +1025,7 @@ static const char* const tfx_fs_all_glsl = "\n" "#ifdef FRAGMENT_SHADER\n" "\n" - "#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts\n" + "#if !defined(BROKEN_DRIVER) && defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts\n" "layout(location = 0)\n" "#endif\n" "in SHADER\n"