Update Vulkan skia creation to use apiVersion instead of instanceVersion
This updates to use Skia's new api which takes the vulkan apiVersion
instead of the instance version. This is technically more correct since
the application apiVersion is really the only client modifiable version
value in vulkan.
This change also updates the webview structs to use the apiVersion as
well.
Test: manual build and testing.
Change-Id: I6ce7c20949eb7242f7bbe69955b54c0785696891
diff --git a/libs/hwui/private/hwui/DrawVkInfo.h b/libs/hwui/private/hwui/DrawVkInfo.h
index abc4dbf..fb55f5c 100644
--- a/libs/hwui/private/hwui/DrawVkInfo.h
+++ b/libs/hwui/private/hwui/DrawVkInfo.h
@@ -29,7 +29,7 @@
VkDevice device;
VkQueue queue;
uint32_t graphics_queue_index;
- uint32_t instance_version;
+ uint32_t api_version;
const char* const* enabled_instance_extension_names;
uint32_t enabled_instance_extension_names_length;
const char* const* enabled_device_extension_names;
diff --git a/libs/hwui/renderthread/VulkanManager.cpp b/libs/hwui/renderthread/VulkanManager.cpp
index 1e75202..582d51e 100644
--- a/libs/hwui/renderthread/VulkanManager.cpp
+++ b/libs/hwui/renderthread/VulkanManager.cpp
@@ -83,7 +83,6 @@
mDevice = VK_NULL_HANDLE;
mPhysicalDevice = VK_NULL_HANDLE;
mInstance = VK_NULL_HANDLE;
- mInstanceVersion = 0u;
mInstanceExtensions.clear();
mDeviceExtensions.clear();
free_features_extensions_structs(mPhysicalDeviceFeatures2);
@@ -100,7 +99,7 @@
0, // applicationVersion
"android framework", // pEngineName
0, // engineVerison
- VK_MAKE_VERSION(1, 1, 0), // apiVersion
+ mAPIVersion, // apiVersion
};
{
@@ -377,8 +376,9 @@
}
GET_PROC(EnumerateInstanceVersion);
- LOG_ALWAYS_FATAL_IF(mEnumerateInstanceVersion(&mInstanceVersion));
- LOG_ALWAYS_FATAL_IF(mInstanceVersion < VK_MAKE_VERSION(1, 1, 0));
+ uint32_t instanceVersion;
+ LOG_ALWAYS_FATAL_IF(mEnumerateInstanceVersion(&instanceVersion));
+ LOG_ALWAYS_FATAL_IF(instanceVersion < VK_MAKE_VERSION(1, 1, 0));
GrVkExtensions extensions;
LOG_ALWAYS_FATAL_IF(!this->setupDevice(extensions, mPhysicalDeviceFeatures2));
@@ -398,7 +398,7 @@
backendContext.fDevice = mDevice;
backendContext.fQueue = mGraphicsQueue;
backendContext.fGraphicsQueueIndex = mGraphicsQueueIndex;
- backendContext.fInstanceVersion = mInstanceVersion;
+ backendContext.fMaxAPIVersion = mAPIVersion;
backendContext.fVkExtensions = &extensions;
backendContext.fDeviceFeatures2 = &mPhysicalDeviceFeatures2;
backendContext.fGetProc = std::move(getProc);
@@ -446,7 +446,7 @@
.device = mDevice,
.queue = mGraphicsQueue,
.graphics_queue_index = mGraphicsQueueIndex,
- .instance_version = mInstanceVersion,
+ .api_version = mAPIVersion,
.enabled_instance_extension_names = mInstanceExtensions.data(),
.enabled_instance_extension_names_length =
static_cast<uint32_t>(mInstanceExtensions.size()),
diff --git a/libs/hwui/renderthread/VulkanManager.h b/libs/hwui/renderthread/VulkanManager.h
index abe78ef..6426fe2 100644
--- a/libs/hwui/renderthread/VulkanManager.h
+++ b/libs/hwui/renderthread/VulkanManager.h
@@ -246,7 +246,7 @@
VkCommandBuffer mDummyCB = VK_NULL_HANDLE;
// Variables saved to populate VkFunctorInitParams.
- uint32_t mInstanceVersion = 0u;
+ static const uint32_t mAPIVersion = VK_MAKE_VERSION(1, 1, 0);
std::vector<const char*> mInstanceExtensions;
std::vector<const char*> mDeviceExtensions;
VkPhysicalDeviceFeatures2 mPhysicalDeviceFeatures2{};