From e6f18bfb42e9c806f86924cad2124e0e1b388e33 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 25 Jun 2025 09:59:03 -0400 Subject: [PATCH] lavapipe: maintenance9 Part-of: --- docs/features.txt | 2 +- src/gallium/frontends/lavapipe/lvp_device.c | 18 +++++++++++++++--- src/gallium/frontends/lavapipe/lvp_private.h | 1 + 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/features.txt b/docs/features.txt index 0bf9a1a06e0..1a7e95e963c 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -552,7 +552,7 @@ Khronos extensions that are not part of any Vulkan version: VK_KHR_get_surface_capabilities2 DONE (anv, hk, lvp, nvk, pvr, radv, tu, v3dv, vn) VK_KHR_incremental_present DONE (anv, hasvk, hk, lvp, nvk, radv, tu, v3dv, vn) VK_KHR_maintenance7 DONE (anv, hk, lvp, nvk, radv, tu, vn) - VK_KHR_maintenance9 DONE (radv) + VK_KHR_maintenance9 DONE (lvp, radv) VK_KHR_performance_query DONE (anv, radv/gfx10.3+, tu, v3dv) VK_KHR_pipeline_binary DONE (radv) VK_KHR_pipeline_executable_properties DONE (anv, hk, nvk, panvk, hasvk, radv, tu, v3dv) diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c index 6f923b32ec6..0b076beed5b 100644 --- a/src/gallium/frontends/lavapipe/lvp_device.c +++ b/src/gallium/frontends/lavapipe/lvp_device.c @@ -157,6 +157,7 @@ static const struct vk_device_extension_table lvp_device_extensions_supported = .KHR_maintenance6 = true, .KHR_maintenance7 = true, .KHR_maintenance8 = true, + .KHR_maintenance9 = true, .KHR_map_memory2 = true, .KHR_multiview = true, .KHR_push_descriptor = true, @@ -755,6 +756,8 @@ lvp_get_features(const struct lvp_physical_device *pdevice, .maintenance7 = true, /* maintenance8 */ .maintenance8 = true, + /* maintenance9 */ + .maintenance9 = true, /* VK_KHR_shader_maximal_reconvergence */ .shaderMaximalReconvergence = true, @@ -1275,6 +1278,10 @@ lvp_get_properties(const struct lvp_physical_device *device, struct vk_propertie p->maxDescriptorSetUpdateAfterBindTotalStorageBuffersDynamic = MAX_DESCRIPTORS / 2; p->maxDescriptorSetUpdateAfterBindTotalBuffersDynamic = MAX_DESCRIPTORS; + /* maintenance9 */ + p->image2DViewOf3DSparse = true; + p->defaultVertexAttributeValue = VK_DEFAULT_VERTEX_ATTRIBUTE_VALUE_ZERO_ZERO_ZERO_ZERO_KHR; + /* VK_EXT_shader_object */ /* this is basically unsupported */ lvp_device_get_cache_uuid(p->shaderBinaryUUID); @@ -1526,6 +1533,9 @@ VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceQueueFamilyProperties2( prio->priorities[2] = VK_QUEUE_GLOBAL_PRIORITY_HIGH_KHR; prio->priorities[3] = VK_QUEUE_GLOBAL_PRIORITY_REALTIME_KHR; } + VkQueueFamilyOwnershipTransferPropertiesKHR *prop = vk_find_struct(pQueueFamilyProperties, QUEUE_FAMILY_OWNERSHIP_TRANSFER_PROPERTIES_KHR); + if (prop) + prop->optimalImageTransferToQueueFamilies = ~0; vk_outarray_append_typed(VkQueueFamilyProperties2, &out, p) { p->queueFamilyProperties = (VkQueueFamilyProperties) { @@ -1782,9 +1792,11 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateDevice( device->pscreen = physical_device->pscreen; - assert(pCreateInfo->queueCreateInfoCount == 1); - assert(pCreateInfo->pQueueCreateInfos[0].queueFamilyIndex == 0); - assert(pCreateInfo->pQueueCreateInfos[0].queueCount == 1); + assert(pCreateInfo->queueCreateInfoCount <= LVP_NUM_QUEUES); + if (pCreateInfo->queueCreateInfoCount) { + assert(pCreateInfo->pQueueCreateInfos[0].queueFamilyIndex == 0); + assert(pCreateInfo->pQueueCreateInfos[0].queueCount == 1); + } result = lvp_queue_init(device, &device->queue, pCreateInfo->pQueueCreateInfos, 0); if (result != VK_SUCCESS) { vk_free(&device->vk.alloc, device); diff --git a/src/gallium/frontends/lavapipe/lvp_private.h b/src/gallium/frontends/lavapipe/lvp_private.h index 816f32c6dee..a4db4b0152c 100644 --- a/src/gallium/frontends/lavapipe/lvp_private.h +++ b/src/gallium/frontends/lavapipe/lvp_private.h @@ -98,6 +98,7 @@ typedef uint32_t xcb_window_t; extern "C" { #endif +#define LVP_NUM_QUEUES 1 #define MAX_SETS 8 #define MAX_DESCRIPTORS 1000000 /* Required by vkd3d-proton */ #define MAX_PUSH_CONSTANTS_SIZE 256