diff --git a/src/venus/vkr_common.h b/src/venus/vkr_common.h index 1fa8c5a..d77d3a1 100644 --- a/src/venus/vkr_common.h +++ b/src/venus/vkr_common.h @@ -176,13 +176,13 @@ void object_array_fini(struct object_array *arr); static inline void * -vkr_find_pnext(const void *chain, VkStructureType type) +vkr_find_struct(const void *chain, VkStructureType type) { - VkBaseOutStructure *pnext = (VkBaseOutStructure *)chain; - while (pnext) { - if (pnext->sType == type) - return pnext; - pnext = pnext->pNext; + VkBaseOutStructure *s = (VkBaseOutStructure *)chain; + while (s) { + if (s->sType == type) + return s; + s = s->pNext; } return NULL; } diff --git a/src/venus/vkr_device_memory.c b/src/venus/vkr_device_memory.c index 1067799..57f4fbb 100644 --- a/src/venus/vkr_device_memory.c +++ b/src/venus/vkr_device_memory.c @@ -48,7 +48,7 @@ vkr_dispatch_vkAllocateMemory(struct vn_dispatch_context *dispatch, #ifdef FORCE_ENABLE_DMABUF VkExportMemoryAllocateInfo local_export_info; if (dev->physical_device->EXT_external_memory_dma_buf) { - VkExportMemoryAllocateInfo *export_info = vkr_find_pnext( + VkExportMemoryAllocateInfo *export_info = vkr_find_struct( args->pAllocateInfo->pNext, VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO); if (export_info) { export_info->handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT; @@ -205,7 +205,7 @@ vkr_dispatch_vkGetMemoryResourcePropertiesMESA( args->pMemoryResourceProperties->memoryTypeBits = mem_fd_props.memoryTypeBits; - VkMemoryResourceAllocationSizeProperties100000MESA *alloc_size_props = vkr_find_pnext( + VkMemoryResourceAllocationSizeProperties100000MESA *alloc_size_props = vkr_find_struct( args->pMemoryResourceProperties->pNext, VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA); if (alloc_size_props)