diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index 704bdce2ac8..181ac011e5c 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_allocator.c @@ -1509,11 +1509,7 @@ anv_bo_vma_alloc_or_close(struct anv_device *device, assert(bo->vma_heap == NULL); assert(explicit_address == intel_48b_address(explicit_address)); - const bool is_small_heap = - alloc_flags & (ANV_BO_ALLOC_DESCRIPTOR_POOL | - ANV_BO_ALLOC_DYNAMIC_VISIBLE_POOL | - ANV_BO_ALLOC_32BIT_ADDRESS); - + const bool is_small_heap = anv_bo_is_small_heap(alloc_flags); uint32_t align = device->physical->info.mem_alignment; /* If it's big enough to store a tiled resource, we need 64K alignment */ diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 2471d1c3329..0c3cd5ca7ba 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -2396,6 +2396,14 @@ void anv_vma_free(struct anv_device *device, struct util_vma_heap *vma_heap, uint64_t address, uint64_t size); +static inline bool +anv_bo_is_small_heap(enum anv_bo_alloc_flags alloc_flags) +{ + return alloc_flags & (ANV_BO_ALLOC_DESCRIPTOR_POOL | + ANV_BO_ALLOC_DYNAMIC_VISIBLE_POOL | + ANV_BO_ALLOC_32BIT_ADDRESS); +} + struct anv_reloc_list { bool uses_relocs; uint32_t dep_words;