From 97970e43e01253d17762016d4c76f63e984f128f Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Tue, 11 Jan 2022 18:21:30 +0000 Subject: [PATCH] Add additional driver validation for BCeNabler --- include/adrenotools/bcenabler.h | 3 ++- src/bcenabler.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/adrenotools/bcenabler.h b/include/adrenotools/bcenabler.h index 733d8ea..3d3a76e 100644 --- a/include/adrenotools/bcenabler.h +++ b/include/adrenotools/bcenabler.h @@ -24,8 +24,9 @@ enum adrenotools_bcn_type { * @brief Checks the status of BCn support in the supplied driver * @param major The major part of VkPhysicalDeviceProperties::driverVersion * @param minor The minor part of VkPhysicalDeviceProperties::driverVersion + * @param vendorId VkPhysicalDeviceProperties::vendorId */ -enum adrenotools_bcn_type adrenotools_get_bcn_type(uint32_t major, uint32_t minor); +enum adrenotools_bcn_type adrenotools_get_bcn_type(uint32_t major, uint32_t minor, uint32_t vendorId); /** * @brief Patches the Adreno graphics driver to enable support for BCn compressed formats diff --git a/src/bcenabler.cpp b/src/bcenabler.cpp index 402924c..8f6ed46 100644 --- a/src/bcenabler.cpp +++ b/src/bcenabler.cpp @@ -8,8 +8,8 @@ #include #include "gen/bcenabler_patch.h" -enum adrenotools_bcn_type adrenotools_get_bcn_type(uint32_t major, uint32_t minor) { - if (major != 512) +enum adrenotools_bcn_type adrenotools_get_bcn_type(uint32_t major, uint32_t minor, uint32_t vendorId) { + if (vendorId != 0x5143 || major != 512) return ADRENOTOOLS_BCN_INCOMPATIBLE; if (minor >= 514)