@@ -439,25 +439,33 @@ void GrVkCaps::applyDriverCorrectnessWorkarounds(const VkPhysicalDevicePropertie
439439 }
440440#endif
441441
442+ // Defaults to zero since all our workaround checks that use this consider things "fixed" once
443+ // above a certain api level. So this will just default to it being less which will enable
444+ // workarounds.
445+ int androidAPIVersion = 0 ;
442446#if defined(SK_BUILD_FOR_ANDROID)
447+ char androidAPIVersionStr[PROP_VALUE_MAX];
448+ int strLength = __system_property_get (" ro.build.version.sdk" , androidAPIVersionStr);
449+ // Defaults to zero since most checks care if it is greater than a specific value. So this will
450+ // just default to it being less.
451+ androidAPIVersion = (strLength == 0 ) ? 0 : atoi (androidAPIVersionStr);
452+ #endif
453+
443454 // Protected memory features have problems in Android P and earlier.
444455 if (fSupportsProtectedMemory && (kQualcomm_VkVendor == properties.vendorID )) {
445- char androidAPIVersion[PROP_VALUE_MAX];
446- int strLength = __system_property_get (" ro.build.version.sdk" , androidAPIVersion);
447- if (strLength == 0 || atoi (androidAPIVersion) <= 28 ) {
456+ if (androidAPIVersion <= 28 ) {
448457 fSupportsProtectedMemory = false ;
449458 }
450459 }
451- #endif
452460
453461 // On Mali galaxy s7 we see lots of rendering issues when we suballocate VkImages.
454462 if (kARM_VkVendor == properties.vendorID ) {
455463 fShouldAlwaysUseDedicatedImageMemory = true ;
456464 }
457465
458466 // On Mali galaxy s7 and s9 we see lots of rendering issues with image filters dropping out when
459- // using only primary command buffers.
460- if (kARM_VkVendor == properties.vendorID ) {
467+ // using only primary command buffers. We also see issues on the P30 running android 28.
468+ if (kARM_VkVendor == properties.vendorID && androidAPIVersion <= 28 ) {
461469 fPreferPrimaryOverSecondaryCommandBuffers = false ;
462470 }
463471
0 commit comments