Skip to content

Commit e206d12

Browse files
authored
Merge pull request #20248 from hrydgard/bxm-driver-enable
Enable Vulkan again on certain Motorola devices, from a certain driver version
2 parents 77b5fca + ece55b5 commit e206d12

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

Common/GPU/Vulkan/VulkanLoader.cpp

+26-13
Original file line numberDiff line numberDiff line change
@@ -317,16 +317,21 @@ static PFN_vkVoidFunction LoadDeviceFuncCore(VkDevice device, const char *name,
317317
static const char * const g_deviceNameBlacklist[] = {
318318
"NVIDIA:SHIELD Tablet K1",
319319
"SDL:Horizon",
320-
"motorola:moto g54 5G", // See issue #18681 / #17825
321320
};
322321

323-
static constexpr std::string_view g_gpuNameBlacklist[] = {
324-
"DuMmY", // avoid an empty array
322+
struct DriverBlackListEntry {
323+
std::string_view deviceNamePrefix;
324+
std::string_view gpuDeviceName;
325+
uint32_t minOkDriverVersion;
326+
};
327+
328+
static constexpr DriverBlackListEntry g_gpuNameBlacklist[] = {
329+
{"motorola:moto g", "PowerVR BXM-8-256", 0x005d9576}, // avoid an empty array
325330
#if PPSSPP_PLATFORM(MAC)
326-
"Intel(R) Iris(TM) Graphics 6000",
327-
"Intel(R) Iris(TM) Graphics 6100",
328-
"Intel(R) Iris(TM) Pro Graphics 6200",
329-
"Intel Iris Pro Graphics",
331+
{"", "Intel(R) Iris(TM) Graphics 6000"},
332+
{"", "Intel(R) Iris(TM) Graphics 6100"},
333+
{"", "Intel(R) Iris(TM) Pro Graphics 6200"},
334+
{"", "Intel Iris Pro Graphics"},
330335
#endif
331336
};
332337

@@ -444,17 +449,17 @@ bool VulkanMayBeAvailable() {
444449
}
445450

446451
// Note: Here it's device name as in the entire physical device, not GPU device.
447-
const std::string name = System_GetProperty(SYSPROP_NAME);
452+
const std::string hwDeviceName = System_GetProperty(SYSPROP_NAME);
448453
for (std::string_view blacklisted_name : g_deviceNameBlacklist) {
449-
if (equals(name, blacklisted_name)) {
450-
INFO_LOG(Log::G3D, "VulkanMayBeAvailable: Device blacklisted ('%s')", name.c_str());
454+
if (equals(hwDeviceName, blacklisted_name)) {
455+
INFO_LOG(Log::G3D, "VulkanMayBeAvailable: Device blacklisted ('%s')", hwDeviceName.c_str());
451456
g_vulkanAvailabilityChecked = true;
452457
g_vulkanMayBeAvailable = false;
453458
return false;
454459
}
455460
}
456461

457-
INFO_LOG(Log::G3D, "VulkanMayBeAvailable: Device allowed ('%s')", name.c_str());
462+
INFO_LOG(Log::G3D, "VulkanMayBeAvailable: Device allowed ('%s')", hwDeviceName.c_str());
458463

459464
std::string errorStr;
460465
VulkanLibraryHandle lib = VulkanLoadLibrary(&errorStr);
@@ -595,8 +600,16 @@ bool VulkanMayBeAvailable() {
595600
// Check with the device blacklist.
596601
bool blacklisted = false;
597602
for (size_t i = 0; i < ARRAY_SIZE(g_gpuNameBlacklist); i++) {
598-
if (equals(props.deviceName, g_gpuNameBlacklist[i])) {
599-
blacklisted = true;
603+
if (startsWith(hwDeviceName, g_gpuNameBlacklist[i].deviceNamePrefix)) {
604+
if (equals(props.deviceName, g_gpuNameBlacklist[i].gpuDeviceName)) {
605+
if (g_gpuNameBlacklist[i].minOkDriverVersion != 0) {
606+
if (props.driverVersion < g_gpuNameBlacklist[i].minOkDriverVersion) {
607+
blacklisted = true;
608+
}
609+
} else {
610+
blacklisted = true;
611+
}
612+
}
600613
}
601614
}
602615
anyGood = !blacklisted;

0 commit comments

Comments
 (0)