From 662abcb2fed6b37ed9cd0285afd68a075ff86534 Mon Sep 17 00:00:00 2001 From: Jonathan Hamilton Date: Sat, 2 Sep 2017 11:25:12 -0700 Subject: [PATCH 1/2] Parse IMGTEC's GL_VERSION string format ImgTec's driver uses a major.minor@changeID versioning system This is packed into a double so "1.9@4850625" becomes "109.4850625" The next release brnach is expected to be 1.10, hence the need for 2 digits for the branch minor. The changeID should be unique for each build, but is shared over all branches, so only makes sense to compare withing a branch. It's likely branch 'major' versions will be used for major hardware revisions, and the drivers for both maintained in parallel. Thus it may not make sense to compare versions between different major verisons - if/when this happens we can hook up a DriverDetails::Family as needed. --- Source/Core/VideoBackends/OGL/Render.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 8d02053fcc..adc58dff28 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -326,6 +326,29 @@ static void InitDriverInfo() version = 100 * major + minor; } break; + case DriverDetails::VENDOR_IMGTEC: + { + // Example version string: + // "OpenGL ES 3.2 build 1.9@4850625" + // Ends up as "109.4850625" - "1.9" being the branch, "4850625" being the build's change ID + // The change ID only makes sense to compare within a branch + driver = DriverDetails::DRIVER_IMGTEC; + double gl_version; + int major, minor, change; + constexpr double change_scale = 10000000; + sscanf(g_ogl_config.gl_version, "OpenGL ES %lg build %d.%d@%d", &gl_version, &major, &minor, + &change); + version = 100 * major + minor; + if (change >= change_scale) + { + ERROR_LOG(VIDEO, "Version changeID overflow - change:%d scale:%f", change, change_scale); + } + else + { + version += static_cast(change) / change_scale; + } + } + break; // We don't care about these default: break; From 658a4a6e2923ae0a8163eac3b77c50bcaef20322 Mon Sep 17 00:00:00 2001 From: Jonathan Hamilton Date: Sat, 2 Sep 2017 13:23:06 -0700 Subject: [PATCH 2/2] Mark an ImgTec driver bug as fixed in 1.8@4693462 Now we correctly parse ImgTec's GL_VERSION string we can actually use the BugInfo's version stuff correctly here --- Source/Core/VideoCommon/DriverDetails.cpp | 2 +- Source/Core/VideoCommon/DriverDetails.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoCommon/DriverDetails.cpp b/Source/Core/VideoCommon/DriverDetails.cpp index 8db1a595b8..d1e159b685 100644 --- a/Source/Core/VideoCommon/DriverDetails.cpp +++ b/Source/Core/VideoCommon/DriverDetails.cpp @@ -95,7 +95,7 @@ static BugInfo m_known_bugs[] = { {API_OPENGL, OS_OSX, VENDOR_INTEL, DRIVER_INTEL, Family::UNKNOWN, BUG_BROKEN_DUAL_SOURCE_BLENDING, -1.0, -1.0, true}, {API_OPENGL, OS_ALL, VENDOR_IMGTEC, DRIVER_IMGTEC, Family::UNKNOWN, - BUG_BROKEN_BITWISE_OP_NEGATION, -1.0, -1.0, true}, + BUG_BROKEN_BITWISE_OP_NEGATION, -1.0, 108.4693462, true}, {API_VULKAN, OS_ALL, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN, BUG_PRIMITIVE_RESTART, -1.0, -1.0, true}, {API_OPENGL, OS_LINUX, VENDOR_MESA, DRIVER_I965, Family::UNKNOWN, diff --git a/Source/Core/VideoCommon/DriverDetails.h b/Source/Core/VideoCommon/DriverDetails.h index a57071ef68..2944797c2f 100644 --- a/Source/Core/VideoCommon/DriverDetails.h +++ b/Source/Core/VideoCommon/DriverDetails.h @@ -242,7 +242,7 @@ enum Bug BUG_BROKEN_DUAL_SOURCE_BLENDING, // BUG: ImgTec GLSL shader compiler fails when negating the input to a bitwise operation // Started version: 1.5 - // Ended version: 1.10 + // Ended version: 1.8@4693462 // Shaders that do something like "variable <<= (-othervariable);" cause the shader to // fail compilation with no useful diagnostic log. This can be worked around by storing // the negated value to a temporary variable then using that in the bitwise op.