Stop using clear-as-draw workaround on newer Intel drivers on macOS

Bug= chromium:777849

Change-Id: I6276cbbf4bf6403ff9bf613d1fb31e56785a035e
Reviewed-on: https://skia-review.googlesource.com/118625
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Brian Salomon 2018-04-04 16:12:31 -04:00 committed by Skia Commit-Bot
parent 4b99bbb076
commit 9a544bcab8
3 changed files with 35 additions and 23 deletions

View File

@ -2158,7 +2158,7 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
// 340.96 and 367.57.
if (kGL_GrGLStandard == ctxInfo.standard() &&
ctxInfo.driver() == kNVIDIA_GrGLDriver &&
ctxInfo.driverVersion() < GR_GL_DRIVER_VER(367, 57)) {
ctxInfo.driverVersion() < GR_GL_DRIVER_VER(367, 57, 0)) {
fClearTextureSupport = false;
}
@ -2177,7 +2177,7 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
// Qualcomm driver @103.0 has been observed to crash compiling ccpr geometry
// shaders. @127.0 is the earliest verified driver to not crash.
if (kQualcomm_GrGLDriver == ctxInfo.driver() &&
ctxInfo.driverVersion() < GR_GL_DRIVER_VER(127,0)) {
ctxInfo.driverVersion() < GR_GL_DRIVER_VER(127, 0, 0)) {
shaderCaps->fGeometryShaderSupport = false;
}
@ -2194,7 +2194,7 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
// did not reproduce on a Nexus7 2013 with a 320 running Android M with driver 127.0. It's
// unclear whether this really affects a wide range of devices.
if (ctxInfo.renderer() == kAdreno3xx_GrGLRenderer &&
ctxInfo.driverVersion() > GR_GL_DRIVER_VER(127, 0)) {
ctxInfo.driverVersion() > GR_GL_DRIVER_VER(127, 0, 0)) {
fMapBufferType = kNone_MapBufferType;
fMapBufferFlags = kNone_MapFlags;
}
@ -2236,7 +2236,10 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
// full screen clears
// crbug.com/773107 - On MacBook Pros, a wide range of Intel GPUs don't always
// perform full screen clears.
if (kIntel_GrGLVendor == ctxInfo.vendor()) {
// Update on 4/4/2018 - This appears to be fixed on driver 10.30.12 on a macOS 10.13.2 on a
// Retina MBP Early 2015 with Iris 6100. It is possibly fixed on earlier drivers as well.
if (kIntel_GrGLVendor == ctxInfo.vendor() &&
ctxInfo.driverVersion() < GR_GL_DRIVER_VER(10, 30, 12)) {
fUseDrawToClearColor = true;
}
#endif
@ -2251,7 +2254,7 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
if (kAdreno4xx_GrGLRenderer == ctxInfo.renderer()) {
// This is known to be fixed sometime between driver 145.0 and 219.0
if (ctxInfo.driverVersion() <= GR_GL_DRIVER_VER(219, 0)) {
if (ctxInfo.driverVersion() <= GR_GL_DRIVER_VER(219, 0, 0)) {
fUseDrawToClearStencilClip = true;
}
fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO = true;
@ -2266,7 +2269,7 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
// - A Nexus 7 2013 (Adreno 320) running Android 4 with driver 53.0
// The particular lines that get dropped from test images varies across different devices.
if (kAdreno3xx_GrGLRenderer == ctxInfo.renderer() &&
ctxInfo.driverVersion() > GR_GL_DRIVER_VER(53, 0)) {
ctxInfo.driverVersion() > GR_GL_DRIVER_VER(53, 0, 0)) {
fRequiresCullFaceEnableDisableWhenDrawingLinesAfterNonLines = true;
}
@ -2436,7 +2439,7 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
// Non-coherent advanced blend has an issue on NVIDIA pre 337.00.
if (kNVIDIA_GrGLDriver == ctxInfo.driver() &&
ctxInfo.driverVersion() < GR_GL_DRIVER_VER(337,00) &&
ctxInfo.driverVersion() < GR_GL_DRIVER_VER(337, 00, 0) &&
kAdvanced_BlendEquationSupport == fBlendEquationSupport) {
fBlendEquationSupport = kBasic_BlendEquationSupport;
shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kNotSupported_AdvBlendEqInteraction;
@ -2444,7 +2447,7 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
if (this->advancedBlendEquationSupport()) {
if (kNVIDIA_GrGLDriver == ctxInfo.driver() &&
ctxInfo.driverVersion() < GR_GL_DRIVER_VER(355,00)) {
ctxInfo.driverVersion() < GR_GL_DRIVER_VER(355, 00, 0)) {
// Blacklist color-dodge and color-burn on pre-355.00 NVIDIA.
fAdvBlendEqBlacklist |= (1 << kColorDodge_GrBlendEquation) |
(1 << kColorBurn_GrBlendEquation);

View File

@ -99,7 +99,7 @@ void GrGLGetDriverInfo(GrGLStandard standard,
const char* versionString,
GrGLDriver* outDriver,
GrGLDriverVersion* outVersion) {
int major, minor, rev, driverMajor, driverMinor;
int major, minor, rev, driverMajor, driverMinor, driverPoint;
*outDriver = kUnknown_GrGLDriver;
*outVersion = GR_GL_DRIVER_UNKNOWN_VER;
@ -128,7 +128,7 @@ void GrGLGetDriverInfo(GrGLStandard standard,
&major, &minor, &rev, &driverMajor, &driverMinor);
// Some older NVIDIA drivers don't report the driver version.
if (5 == n) {
*outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor);
*outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor, 0);
}
return;
}
@ -140,7 +140,7 @@ void GrGLGetDriverInfo(GrGLStandard standard,
}
if (4 == n) {
*outDriver = kMesa_GrGLDriver;
*outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor);
*outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor, 0);
return;
}
}
@ -151,7 +151,7 @@ void GrGLGetDriverInfo(GrGLStandard standard,
&major, &minor, &driverMajor, &driverMinor);
// Some older NVIDIA drivers don't report the driver version.
if (4 == n) {
*outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor);
*outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor, 0);
}
return;
}
@ -160,7 +160,7 @@ void GrGLGetDriverInfo(GrGLStandard standard,
&major, &minor, &driverMajor, &driverMinor);
if (4 == n) {
*outDriver = kMesa_GrGLDriver;
*outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor);
*outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor, 0);
return;
}
if (0 == strncmp("ANGLE", rendererString, 5)) {
@ -168,7 +168,7 @@ void GrGLGetDriverInfo(GrGLStandard standard,
n = sscanf(versionString, "OpenGL ES %d.%d (ANGLE %d.%d", &major, &minor, &driverMajor,
&driverMinor);
if (4 == n) {
*outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor);
*outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor, 0);
}
return;
}
@ -177,6 +177,14 @@ void GrGLGetDriverInfo(GrGLStandard standard,
if (kIntel_GrGLVendor == vendor) {
// We presume we're on the Intel driver since it hasn't identified itself as Mesa.
*outDriver = kIntel_GrGLDriver;
//This is how the macOS version strings are structured. This might be different on different
// OSes.
int n = sscanf(versionString, "%d.%d INTEL-%d.%d.%d", &major, &minor, &driverMajor,
&driverMinor, &driverPoint);
if (5 == n) {
*outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor, driverPoint);
}
}
if (kQualcomm_GrGLVendor == vendor) {
@ -184,7 +192,7 @@ void GrGLGetDriverInfo(GrGLStandard standard,
int n = sscanf(versionString, "OpenGL ES %d.%d V@%d.%d", &major, &minor, &driverMajor,
&driverMinor);
if (4 == n) {
*outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor);
*outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor, 0);
}
return;
}

View File

@ -19,18 +19,19 @@ class SkMatrix;
typedef uint32_t GrGLVersion;
typedef uint32_t GrGLSLVersion;
typedef uint32_t GrGLDriverVersion;
typedef uint64_t GrGLDriverVersion;
#define GR_GL_VER(major, minor) ((static_cast<int>(major) << 16) | \
static_cast<int>(minor))
#define GR_GLSL_VER(major, minor) ((static_cast<int>(major) << 16) | \
static_cast<int>(minor))
#define GR_GL_DRIVER_VER(major, minor) ((static_cast<int>(major) << 16) | \
static_cast<int>(minor))
#define GR_GL_VER(major, minor) ((static_cast<uint32_t>(major) << 16) | \
static_cast<uint32_t>(minor))
#define GR_GLSL_VER(major, minor) ((static_cast<uint32_t>(major) << 16) | \
static_cast<uint32_t>(minor))
#define GR_GL_DRIVER_VER(major, minor, point) ((static_cast<uint64_t>(major) << 32) | \
(static_cast<uint64_t>(minor) << 16) | \
static_cast<uint64_t>(point))
#define GR_GL_INVALID_VER GR_GL_VER(0, 0)
#define GR_GLSL_INVALID_VER GR_GLSL_VER(0, 0)
#define GR_GL_DRIVER_UNKNOWN_VER GR_GL_DRIVER_VER(0, 0)
#define GR_GL_DRIVER_UNKNOWN_VER GR_GL_DRIVER_VER(0, 0, 0)
/**
* The Vendor and Renderer enum values are lazily updated as required.