Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 6ed2dcc

Browse files
egdanielSkia Commit-Bot
authored andcommitted
Don't require secondary command buffers on mali vk.
Change-Id: Ib2c3a55421fa3f052f337be6b75022fa4d30ac8d Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314319 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
1 parent c7fa895 commit 6ed2dcc

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/gpu/vk/GrVkCaps.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)