venus: add vn_queue_family_can_feedback helper

No behavior change. This is to prepare for better feedback
compatibility support.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38049>
This commit is contained in:
Yiwei Zhang
2025-10-23 19:36:41 -07:00
committed by Marge Bot
parent dd4df28ef2
commit 30b41c2b57
2 changed files with 18 additions and 11 deletions
+2 -11
View File
@@ -810,7 +810,6 @@ vn_feedback_cmd_pools_init(struct vn_device *dev)
{
const VkAllocationCallbacks *alloc = &dev->base.vk.alloc;
VkDevice dev_handle = vn_device_to_handle(dev);
struct vn_physical_device *physical_dev = dev->physical_device;
struct vn_feedback_cmd_pool *fb_cmd_pools;
VkCommandPoolCreateInfo info = {
.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
@@ -833,16 +832,8 @@ vn_feedback_cmd_pools_init(struct vn_device *dev)
for (uint32_t i = 0; i < dev->queue_family_count; i++) {
VkResult result;
/* Feedback requires transfer capability, so we must skip feedback cmd
* pool initialization on incompatible queue families. Meanwhile, use
* pool_handle for all validity check needed.
*/
assert(dev->queue_families[i] < physical_dev->queue_family_count);
const struct VkQueueFamilyProperties2 *props =
&physical_dev->queue_family_properties[dev->queue_families[i]];
const VkQueueFlags fb_req_flags =
VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT;
if (!(props->queueFamilyProperties.queueFlags & fb_req_flags)) {
if (!vn_queue_family_can_feedback(dev->physical_device,
dev->queue_families[i])) {
fb_cmd_pools[i].pool_handle = VK_NULL_HANDLE;
continue;
}
+16
View File
@@ -141,4 +141,20 @@ VK_DEFINE_HANDLE_CASTS(vn_physical_device,
void
vn_physical_device_fini(struct vn_physical_device *physical_dev);
static inline bool
vn_queue_family_can_feedback(struct vn_physical_device *physical_dev,
uint32_t queue_family_index)
{
/* Feedback requires transfer capability, so we must skip feedback cmd pool
* initialization on incompatible queue families. Meanwhile, rely on the
* pool_handle for all validity check needed.
*/
assert(queue_family_index < physical_dev->queue_family_count);
const struct VkQueueFamilyProperties2 *props =
&physical_dev->queue_family_properties[queue_family_index];
const VkQueueFlags transfer_flags =
VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT;
return props->queueFamilyProperties.queueFlags & transfer_flags;
}
#endif /* VN_PHYSICAL_DEVICE_H */