mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[android] Use OpenGL on Emulator API 30 and 36 (Android 11 and 16)
OM crashes likely due to some bugs in Vulkan driver Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
committed by
Konstantin Pastbin
parent
90492e95e6
commit
a036edc9c5
@@ -108,9 +108,17 @@ bool SupportManager::IsVulkanForbidden()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool SupportManager::IsVulkanForbidden(std::string const & deviceName, Version apiVersion,
|
bool SupportManager::IsVulkanForbidden(std::string const & deviceName, Version apiVersion,
|
||||||
Version driverVersion, bool isCustomROM)
|
Version driverVersion, bool isCustomROM, int sdkVersion)
|
||||||
{
|
{
|
||||||
LOG(LINFO, ("Device =", deviceName, "API =", apiVersion, "Driver =", driverVersion));
|
LOG(LINFO, ("Device =", deviceName, "API =", apiVersion, "Driver =", driverVersion, "SDK =", sdkVersion));
|
||||||
|
|
||||||
|
// Vulkan crashes on Android Emulator (API 30 and API 36), likely due to some bug in the emulator's driver.
|
||||||
|
// TODO(AB): Remove this workaround when it is fixed.
|
||||||
|
if (deviceName == "SwiftShader Device (LLVM 10.0.0)" && (sdkVersion == 30 || sdkVersion == 36))
|
||||||
|
{
|
||||||
|
LOG(LWARNING, ("Use OpenGL instead of Vulkan on Android Emulator due to crashes caused by graphics driver."));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static char const * kBannedDevices[] = {
|
static char const * kBannedDevices[] = {
|
||||||
/// @todo Should we ban all PowerVR Rogue devices?
|
/// @todo Should we ban all PowerVR Rogue devices?
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ public:
|
|||||||
|
|
||||||
using Version = std::array<uint32_t, 3>;
|
using Version = std::array<uint32_t, 3>;
|
||||||
static bool IsVulkanForbidden();
|
static bool IsVulkanForbidden();
|
||||||
static bool IsVulkanForbidden(std::string const & deviceName, Version apiVersion, Version driverVersion, bool isCustomROM);
|
static bool IsVulkanForbidden(std::string const & deviceName, Version apiVersion, Version driverVersion,
|
||||||
|
bool isCustomROM, int sdkVersion);
|
||||||
static bool IsVulkanTexturePartialUpdateBuggy(int sdkVersion, std::string const & deviceName,
|
static bool IsVulkanTexturePartialUpdateBuggy(int sdkVersion, std::string const & deviceName,
|
||||||
Version apiVersion, Version driverVersion);
|
Version apiVersion, Version driverVersion);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#include "drape/vulkan/vulkan_context_factory.hpp"
|
#include "drape/vulkan/vulkan_context_factory.hpp"
|
||||||
|
|
||||||
#include "drape/drape_diagnostics.hpp"
|
|
||||||
#include "drape/support_manager.hpp"
|
#include "drape/support_manager.hpp"
|
||||||
#include "drape/vulkan/vulkan_pipeline.hpp"
|
#include "drape/vulkan/vulkan_pipeline.hpp"
|
||||||
#include "drape/vulkan/vulkan_utils.hpp"
|
#include "drape/vulkan/vulkan_utils.hpp"
|
||||||
@@ -8,9 +7,7 @@
|
|||||||
#include "base/assert.hpp"
|
#include "base/assert.hpp"
|
||||||
#include "base/logging.hpp"
|
#include "base/logging.hpp"
|
||||||
#include "base/macros.hpp"
|
#include "base/macros.hpp"
|
||||||
#include "base/src_point.hpp"
|
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace dp
|
namespace dp
|
||||||
@@ -168,7 +165,8 @@ VulkanContextFactory::VulkanContextFactory(uint32_t appVersionCode, int sdkVersi
|
|||||||
dp::SupportManager::Version driverVersion{VK_VERSION_MAJOR(gpuProperties.driverVersion),
|
dp::SupportManager::Version driverVersion{VK_VERSION_MAJOR(gpuProperties.driverVersion),
|
||||||
VK_VERSION_MINOR(gpuProperties.driverVersion),
|
VK_VERSION_MINOR(gpuProperties.driverVersion),
|
||||||
VK_VERSION_PATCH(gpuProperties.driverVersion)};
|
VK_VERSION_PATCH(gpuProperties.driverVersion)};
|
||||||
if (dp::SupportManager::Instance().IsVulkanForbidden(gpuProperties.deviceName, apiVersion, driverVersion, isCustomROM))
|
if (dp::SupportManager::Instance().IsVulkanForbidden(gpuProperties.deviceName, apiVersion, driverVersion,
|
||||||
|
isCustomROM, sdkVersion))
|
||||||
{
|
{
|
||||||
LOG_ERROR_VK("GPU/Driver configuration is not supported.");
|
LOG_ERROR_VK("GPU/Driver configuration is not supported.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user