summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2013-02-14 18:59:45 +0100
committerdegasus <wickmarkus@web.de>2013-02-14 18:59:45 +0100
commita0ef58418b7c99bb4c2e426d98acc44e29a4295a (patch)
tree730ae8130792c8794827ec0dc89ffbf413fb0e1c /Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
parent0325e37bfb4269500a03ac48f8ff7ca8ab94e101 (diff)
workaround for buggy intel windows driver. revert this as soon as there are newer driver
Diffstat (limited to 'Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
index 51a7887308..4a943b42d5 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
@@ -488,6 +488,19 @@ void ProgramShaderCache::Shutdown(void)
void ProgramShaderCache::CreateHeader ( void )
{
+#ifdef _WIN32
+ // Intel Windows driver has a issue:
+ // their glsl doesn't know about the ubo extension, so we can't load it.
+ // but as version 140, ubo is in core and don't have to be loaded in glsl.
+ // as sandy do ogl3.1, glsl 140 is supported, so force it in this way.
+ // TODO: remove this again when the issue is fixed:
+ // see http://communities.intel.com/thread/36084
+ u8 *vendor = glGetString(GL_VENDOR);
+ bool intel_windows_hack = strcmp(vendor, "Intel") == 0;
+#else
+ bool intel_windows_hack = false;
+#endif
+
snprintf(s_glsl_header, sizeof(s_glsl_header),
"#version %s\n"
"#extension GL_ARB_texture_rectangle : enable\n"
@@ -510,8 +523,8 @@ void ProgramShaderCache::CreateHeader ( void )
"#define lerp(x, y, z) mix(x, y, z)\n"
- , "130"
- , g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "#extension GL_ARB_uniform_buffer_object : enable" : "// ubo disabled"
+ , intel_windows_hack ? "140" : "130"
+ , g_ActiveConfig.backend_info.bSupportsGLSLUBO && !intel_windows_hack ? "#extension GL_ARB_uniform_buffer_object : enable" : "// ubo disabled"
);
}