Skip to content
Permalink
Browse files

Vulkan: Simple blacklist of device names that are not allowed to chec…

…k for Vulkan. Will help #12093.
  • Loading branch information...
hrydgard committed Aug 13, 2019
1 parent 825dac3 commit 8788c1e678ef65e7ad5242cb300664d7a8ede94c
Showing with 17 additions and 0 deletions.
  1. +17 −0 Common/Vulkan/VulkanLoader.cpp
@@ -17,8 +17,11 @@

#include "Common/Vulkan/VulkanLoader.h"
#include <vector>
#include <string>

#include "base/logging.h"
#include "base/basictypes.h"
#include "base/NativeApp.h"

#ifndef _WIN32
#include <dlfcn.h>
@@ -226,6 +229,10 @@ bool g_vulkanMayBeAvailable = false;

#define LOAD_GLOBAL_FUNC_LOCAL(lib, x) (PFN_ ## x)dlsym(lib, #x);

static const char *device_name_blacklist[] = {
"SHIELD Tablet",
};

static const char *so_names[] = {
"libvulkan.so",
"libvulkan.so.1",
@@ -239,6 +246,16 @@ void VulkanSetAvailable(bool available) {
bool VulkanMayBeAvailable() {
if (g_vulkanAvailabilityChecked)
return g_vulkanMayBeAvailable;

std::string name = System_GetProperty(SYSPROP_NAME);
for (size_t i = 0; i < ARRAY_SIZE(device_name_blacklist); i++) {
if (name == device_name_blacklist[i]) {
g_vulkanAvailabilityChecked = true;
g_vulkanMayBeAvailable = false;
return false;
}
}

#ifndef _WIN32
void *lib = nullptr;
for (int i = 0; i < ARRAY_SIZE(so_names); i++) {

0 comments on commit 8788c1e

Please sign in to comment.
You can’t perform that action at this time.