summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chris Forbes <chrisforbes@google.com> 2024-11-25 23:39:52 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-11-25 23:39:52 +0000
commitcac99c54f7a586f78fb69e29aedbf1fe24f9ddbb (patch)
tree6ae6a4cd5f471c979666fec87e3420e00b37b077
parent826f8380056f756dbbc3eae5e36f7114fc8b5eea (diff)
parent832f586297e5b448647188ffab91ed466bc3d5a9 (diff)
Merge "Add GraphicsEnvironment support for Vulkan 1.4" into main
-rw-r--r--core/java/android/os/GraphicsEnvironment.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java
index 94768d111ca4..8f6a50843ddb 100644
--- a/core/java/android/os/GraphicsEnvironment.java
+++ b/core/java/android/os/GraphicsEnvironment.java
@@ -98,6 +98,7 @@ public class GraphicsEnvironment {
private static final int VULKAN_1_1 = 0x00401000;
private static final int VULKAN_1_2 = 0x00402000;
private static final int VULKAN_1_3 = 0x00403000;
+ private static final int VULKAN_1_4 = 0x00404000;
// Values for UPDATABLE_DRIVER_ALL_APPS
// 0: Default (Invalid values fallback to default as well)
@@ -179,6 +180,10 @@ 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_4)) {
+ return VULKAN_1_4;
+ }
+
if (pm.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, VULKAN_1_3)) {
return VULKAN_1_3;
}