Don't use geometry shaders on older Adreno chips

These appear to be implemented in software. The CCPR vertex impl is
significantly faster.

Bug: skia:8104
Change-Id: I711b2f805361303a10a6ffcb9c4d68e1c8fca249
Reviewed-on: https://skia-review.googlesource.com/138407
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
Chris Dalton 2018-06-28 19:06:27 -06:00 committed by Skia Commit-Bot
parent 9fc102362c
commit 1214be9906
3 changed files with 20 additions and 9 deletions

View File

@ -329,9 +329,13 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
shaderCaps->fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0) ||
ctxInfo.hasExtension("GL_OES_standard_derivatives");
// Mali has support for geometry shaders, but in practice with ccpr they are slower than the
// backup impl that only uses vertex shaders.
if (kARM_GrGLVendor != ctxInfo.vendor()) {
// Mali and early Adreno both have support for geometry shaders, but they appear to be
// implemented in software. In practice with ccpr, they are slower than the backup impl that
// only uses vertex shaders.
if (kARM_GrGLVendor != ctxInfo.vendor() &&
kAdreno3xx_GrGLRenderer != ctxInfo.renderer() &&
kAdreno4xx_other_GrGLRenderer != ctxInfo.renderer()) {
if (ctxInfo.version() >= GR_GL_VER(3,2)) {
shaderCaps->fGeometryShaderSupport = true;
} else if (ctxInfo.hasExtension("GL_EXT_geometry_shader")) {
@ -1356,7 +1360,9 @@ void GrGLCaps::initConfigTable(const GrContextOptions& contextOptions,
// NexusPlayer has strange bugs with sRGB (skbug.com/4148). This is a targeted fix to
// blacklist that device (and any others that might be sharing the same driver).
disableSRGBForX86PowerVR = isX86PowerVR;
disableSRGBWriteControlForAdreno4xx = kAdreno4xx_GrGLRenderer == ctxInfo.renderer();
disableSRGBWriteControlForAdreno4xx =
(kAdreno430_GrGLRenderer == ctxInfo.renderer() ||
kAdreno4xx_other_GrGLRenderer == ctxInfo.renderer());
// Angle with es2->GL has a bug where it will hang trying to call TexSubImage on GL_R8
// formats on miplevels > 0. We already disable texturing on gles > 2.0 so just need to
@ -2337,7 +2343,8 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
GrShaderCaps* shaderCaps) {
// A driver but on the nexus 6 causes incorrect dst copies when invalidate is called beforehand.
// Thus we are blacklisting this extension for now on Adreno4xx devices.
if (kAdreno4xx_GrGLRenderer == ctxInfo.renderer() ||
if (kAdreno430_GrGLRenderer == ctxInfo.renderer() ||
kAdreno4xx_other_GrGLRenderer == ctxInfo.renderer() ||
fDriverBugWorkarounds.disable_discard_framebuffer) {
fDiscardRenderTargetSupport = false;
fInvalidateFBType = kNone_InvalidateFBType;
@ -2441,7 +2448,8 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
fUseDrawToClearColor = true;
}
if (kAdreno4xx_GrGLRenderer == ctxInfo.renderer()) {
if (kAdreno430_GrGLRenderer == ctxInfo.renderer() ||
kAdreno4xx_other_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, 0)) {
fUseDrawToClearStencilClip = true;
@ -2620,7 +2628,8 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
// Disabling advanced blend on various platforms with major known issues. We also block Chrome
// for now until its own blacklists can be updated.
if (kAdreno4xx_GrGLRenderer == ctxInfo.renderer() ||
if (kAdreno430_GrGLRenderer == ctxInfo.renderer() ||
kAdreno4xx_other_GrGLRenderer == ctxInfo.renderer() ||
kAdreno5xx_GrGLRenderer == ctxInfo.renderer() ||
kIntel_GrGLDriver == ctxInfo.driver() ||
kChromium_GrGLDriver == ctxInfo.driver()) {

View File

@ -356,7 +356,8 @@ GrGLRenderer GrGLGetRendererFromStrings(const char* rendererString,
return kAdreno3xx_GrGLRenderer;
}
if (adrenoNumber < 500) {
return kAdreno4xx_GrGLRenderer;
return adrenoNumber >= 430
? kAdreno430_GrGLRenderer : kAdreno4xx_other_GrGLRenderer;
}
if (adrenoNumber < 600) {
return kAdreno5xx_GrGLRenderer;

View File

@ -54,7 +54,8 @@ enum GrGLRenderer {
kPowerVR54x_GrGLRenderer,
kPowerVRRogue_GrGLRenderer,
kAdreno3xx_GrGLRenderer,
kAdreno4xx_GrGLRenderer,
kAdreno430_GrGLRenderer,
kAdreno4xx_other_GrGLRenderer,
kAdreno5xx_GrGLRenderer,
kOSMesa_GrGLRenderer,
kGoogleSwiftShader_GrGLRenderer,