summaryrefslogtreecommitdiff
path: root/core/java/android/os/GraphicsEnvironment.java
diff options
context:
space:
mode:
authorTrevor David Black <vantablack@google.com>2022-04-21 18:03:07 +0000
committerTrevor David Black <vantablack@google.com>2022-04-21 18:03:07 +0000
commitbf22232e3c6418fee76f700389cfaa9bf4c81992 (patch)
tree4dd0e6e59d8dcb8baa9fe64abbfc8ba6bae5eaec /core/java/android/os/GraphicsEnvironment.java
parent04b94c550df14bd8d81ba87ebe2618071fb088e2 (diff)
Add Vulkan 1.2 and 1.3 to getVulkanVersion()
Bug: 191881132 Test: build Change-Id: I73d18850180f2d7a627fb3879e4653d0e470d6fb
Diffstat (limited to 'core/java/android/os/GraphicsEnvironment.java')
-rw-r--r--core/java/android/os/GraphicsEnvironment.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java
index c6cf09789899..cb7e6f71a8fd 100644
--- a/core/java/android/os/GraphicsEnvironment.java
+++ b/core/java/android/os/GraphicsEnvironment.java
@@ -94,6 +94,8 @@ public class GraphicsEnvironment {
private static final int VULKAN_1_0 = 0x00400000;
private static final int VULKAN_1_1 = 0x00401000;
+ private static final int VULKAN_1_2 = 0x00402000;
+ private static final int VULKAN_1_3 = 0x00403000;
// Values for UPDATABLE_DRIVER_ALL_APPS
// 0: Default (Invalid values fallback to default as well)
@@ -213,6 +215,14 @@ public class GraphicsEnvironment {
private int getVulkanVersion(PackageManager pm) {
// PackageManager doesn't have an API to retrieve the version of a specific feature, and we
// need to avoid retrieving all system features here and looping through them.
+ if (pm.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, VULKAN_1_3)) {
+ return VULKAN_1_3;
+ }
+
+ if (pm.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, VULKAN_1_2)) {
+ return VULKAN_1_2;
+ }
+
if (pm.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, VULKAN_1_1)) {
return VULKAN_1_1;
}