Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #972 from Sonicadvance1/fix-intel-windows
Work around Intel's failings with buffer_storage
  • Loading branch information
shuffle2 committed Sep 5, 2014
2 parents bb60caf + e32b2e1 commit 0576046
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
15 changes: 10 additions & 5 deletions Source/Core/VideoBackends/OGL/Render.cpp
Expand Up @@ -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:
{
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/VideoBackends/OGL/StreamBuffer.cpp
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Source/Core/VideoCommon/DriverDetails.cpp
Expand Up @@ -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<Bug, BugInfo> m_bugs;
Expand Down
8 changes: 8 additions & 0 deletions Source/Core/VideoCommon/DriverDetails.h
Expand Up @@ -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
Expand Down

0 comments on commit 0576046

Please sign in to comment.