Skip to content

v3dv: use vk_properties (and extend the runtime to support PresentationPropertiesANDROID)

Oskar Viljasaar requested to merge tshikaboom/mesa:v3dv-properties into main

What does this MR do and why?

This MR enables v3dv to get rid of the GetPhysicalDeviceProperties and GetPhysicalDeviceProperties2 entrypoints, letting the runtime do the iteration over the vk_properties struct now filled in at device initialization time. To do that, the properties generator had to be extended a bit to also support VkPhysicalDevicePresentationPropertiesANDROID, as this property does not get picked up by the script automatically. (it is not marked as a structextend to VkPhysicalDeviceProperties2 in vk.xml, besides being platform-specific to Android)

First commit (vulkan/properties: Move beta extension checking to a separate function) is just a cleanup/refactoring. I actually wonder if that worked before, as Meson passes "true"/"false" strings as arguments to the script, and the not beta condition just checks if the variable is not None...

Second commit adds support for VkPhysicalDevicePresentationPropertiesANDROID in the runtime. I tried another approach of generating/not generating code depending on whether the Android platform was enabled in the build system, but I suspect this approach of always generating code (just being ifdeffed behind ANDROID) makes for more predictable results.

Third commit is a trivial cleanup, and fourth commit is what I'm describing in the first paragraph. :)

Tested by doing a diff on vulkaninfo output before and after this change:

pi@raspberrypi:~/dev/mesa $ diff -u ~/dev/vulkaninfo-orig ~/dev/vulkaninfo-vkproperties 
--- /home/pi/dev/vulkaninfo-orig	2023-11-27 14:16:52.765679300 +0000
+++ /home/pi/dev/vulkaninfo-vkproperties	2023-11-28 13:45:49.196716971 +0000
@@ -87,7 +87,7 @@
 	deviceID          = 0xbe485fd3
 	deviceType        = PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU
 	deviceName        = V3D 4.2.14
-	pipelineCacheUUID = b984f13e-c494-6317-5d1e-39c38605bf79
+	pipelineCacheUUID = 8f5578f1-03a5-f46a-bb74-56134b4ea347
 
 VkPhysicalDeviceLimits:
 -----------------------
@@ -280,7 +280,7 @@
 ---------------------------------
 	driverID        = DRIVER_ID_MESA_V3DV
 	driverName      = V3DV Mesa
-	driverInfo      = Mesa 24.0.0-devel (git-cf510e38a5)
+	driverInfo      = Mesa 24.0.0-devel (git-847ebed5ec)
 	conformanceVersion:
 		major    = 1
 		minor    = 3
@@ -319,7 +319,7 @@
 VkPhysicalDeviceIDProperties:
 -----------------------------
 	deviceUUID      = 2ed13185-e77c-e2ea-cfd5-078818d4e3e5
-	driverUUID      = dd23efab-0662-b8a2-6c68-c6ec72c2b1b7
+	driverUUID      = eec71b0e-b3ed-65d5-0d76-bd06bdfe289a
 	deviceNodeMask  = 0
 	deviceLUIDValid = false
 
@@ -446,7 +446,7 @@
 VkPhysicalDeviceVulkan11Properties:
 -----------------------------------
 	deviceUUID                        = 2ed13185-e77c-e2ea-cfd5-078818d4e3e5
-	driverUUID                        = dd23efab-0662-b8a2-6c68-c6ec72c2b1b7
+	driverUUID                        = eec71b0e-b3ed-65d5-0d76-bd06bdfe289a
 	deviceNodeMask                    = 0
 	deviceLUIDValid                   = false
 	subgroupSize                      = 16
@@ -466,7 +466,7 @@
 -----------------------------------
 	driverID                                             = DRIVER_ID_MESA_V3DV
 	driverName                                           = V3DV Mesa
-	driverInfo                                           = Mesa 24.0.0-devel (git-cf510e38a5)
+	driverInfo                                           = Mesa 24.0.0-devel (git-847ebed5ec)
 	conformanceVersion:
 		major    = 1
 		minor    = 3

This MR is untested on an actual build of Android though.

Also, hello, I'm new :)

Merge request reports