From e32b2e17711939475c19771edeb619721362eb0a Mon Sep 17 00:00:00 2001 From: Sonicadvance1 Date: Thu, 4 Sep 2014 18:03:53 -0500 Subject: [PATCH] Work around Intel's failings with with buffer_storage --- Source/Core/VideoBackends/OGL/Render.cpp | 15 ++++++++++----- Source/Core/VideoBackends/OGL/StreamBuffer.cpp | 3 ++- Source/Core/VideoCommon/DriverDetails.cpp | 1 + Source/Core/VideoCommon/DriverDetails.h | 8 ++++++++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 85836f0c11..e350d4df1b 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -315,17 +315,22 @@ static void InitDriverInfo() version = 100*major + 10*minor + release; } break; - case DriverDetails::VENDOR_INTEL: // Happens in OS X + case DriverDetails::VENDOR_INTEL: // Happens in OS X/Windows + { sscanf(g_ogl_config.gl_renderer, "Intel HD Graphics %d", &family); - /* +#ifdef _WIN32 int glmajor = 0; int glminor = 0; int major = 0; int minor = 0; int release = 0; - sscanf(g_ogl_config.gl_version, "%d.%d INTEL-%d.%d.%d", &glmajor, &glminor, &major, &minor, &release); - version = 10000*major + 1000*minor + release; - */ + int revision = 0; + // Example version string: '4.3.0 - Build 10.18.10.3907' + sscanf(g_ogl_config.gl_version, "%d.%d.0 - Build %d.%d.%d.%d", &glmajor, &glminor, &major, &minor, &release, &revision); + version = 100000000 * major + 1000000 * minor + 10000 * release + revision; + version /= 10000; +#endif + } break; case DriverDetails::VENDOR_NVIDIA: { diff --git a/Source/Core/VideoBackends/OGL/StreamBuffer.cpp b/Source/Core/VideoBackends/OGL/StreamBuffer.cpp index 91d4692b08..5406b6e14c 100644 --- a/Source/Core/VideoBackends/OGL/StreamBuffer.cpp +++ b/Source/Core/VideoBackends/OGL/StreamBuffer.cpp @@ -378,7 +378,8 @@ StreamBuffer* StreamBuffer::Create(u32 type, u32 size) // buffer storage works well in most situations if (g_ogl_config.bSupportsGLBufferStorage && - !(DriverDetails::HasBug(DriverDetails::BUG_BROKENBUFFERSTORAGE) && type == GL_ARRAY_BUFFER)) + !(DriverDetails::HasBug(DriverDetails::BUG_BROKENBUFFERSTORAGE) && type == GL_ARRAY_BUFFER) && + !(DriverDetails::HasBug(DriverDetails::BUG_INTELBROKENBUFFERSTORAGE) && type == GL_ELEMENT_ARRAY_BUFFER)) return new BufferStorage(type, size); // don't fall back to MapAnd* for nvidia drivers diff --git a/Source/Core/VideoCommon/DriverDetails.cpp b/Source/Core/VideoCommon/DriverDetails.cpp index 5e65021244..5e00ddd02d 100644 --- a/Source/Core/VideoCommon/DriverDetails.cpp +++ b/Source/Core/VideoCommon/DriverDetails.cpp @@ -57,6 +57,7 @@ namespace DriverDetails {OS_OSX, VENDOR_INTEL, DRIVER_INTEL, 3000, BUG_PRIMITIVERESTART, -1.0, -1.0, true}, {OS_WINDOWS,VENDOR_NVIDIA, DRIVER_NVIDIA, -1, BUG_BROKENUNSYNCMAPPING, -1.0, -1.0, true}, {OS_LINUX, VENDOR_NVIDIA, DRIVER_NVIDIA, -1, BUG_BROKENUNSYNCMAPPING, -1.0, -1.0, true}, + {OS_WINDOWS,VENDOR_INTEL, DRIVER_INTEL, -1, BUG_INTELBROKENBUFFERSTORAGE, 101810.3907, -1.0, true}, }; static std::map m_bugs; diff --git a/Source/Core/VideoCommon/DriverDetails.h b/Source/Core/VideoCommon/DriverDetails.h index 43aa595239..3e2912ed9b 100644 --- a/Source/Core/VideoCommon/DriverDetails.h +++ b/Source/Core/VideoCommon/DriverDetails.h @@ -174,6 +174,14 @@ namespace DriverDetails // Qualcomm in their infinite wisdom thought it was a good idea to rotate the framebuffer 180 degrees on glBlit // This bug allows us to work around that rotation by rotating it the right way around again. BUG_ROTATEDFRAMEBUFFER, + // Bug: Intel's Window driver broke buffer_storage with GL_ELEMENT_ARRAY_BUFFER + // Affected devices: Intel (Windows) + // Started Version: 15.36.3.64.3907 (10.18.10.3907) + // Ended Version: -1 + // Intel implemented buffer_storage in their GL 4.3 driver. + // It works for all the buffer types we use except GL_ELEMENT_ARRAY_BUFFER. + // Causes complete blackscreen issues. + BUG_INTELBROKENBUFFERSTORAGE, }; // Initializes our internal vendor, device family, and driver version