}
VkResult
-vn_android_init_ahb_buffer_memory_type_bits(struct vn_device *dev)
+vn_android_get_ahb_buffer_memory_type_bits(struct vn_device *dev,
+ uint32_t *out_mem_type_bits)
{
const uint32_t format = AHARDWAREBUFFER_FORMAT_BLOB;
/* ensure dma_buf_memory_type_bits covers host visible usage */
if (result != VK_SUCCESS)
return result;
- dev->ahb_buffer_memory_type_bits = mem_type_bits;
+ *out_mem_type_bits = mem_type_bits;
return VK_SUCCESS;
}
struct vn_buffer **out_buf);
VkResult
-vn_android_init_ahb_buffer_memory_type_bits(struct vn_device *dev);
+vn_android_get_ahb_buffer_memory_type_bits(struct vn_device *dev,
+ uint32_t *out_mem_type_bits);
#else
}
static inline VkResult
-vn_android_init_ahb_buffer_memory_type_bits(UNUSED struct vn_device *dev)
+vn_android_get_ahb_buffer_memory_type_bits(UNUSED struct vn_device *dev,
+ UNUSED uint32_t *out_mem_type_bits)
{
return VK_ERROR_FEATURE_NOT_PRESENT;
}
if (dev->base.base.enabled_extensions
.ANDROID_external_memory_android_hardware_buffer) {
- result = vn_android_init_ahb_buffer_memory_type_bits(dev);
+ uint32_t mem_type_bits = 0;
+ result =
+ vn_android_get_ahb_buffer_memory_type_bits(dev, &mem_type_bits);
if (result != VK_SUCCESS)
goto fail;
+
+ dev->ahb_buffer_memory_type_bits = mem_type_bits;
}
return VK_SUCCESS;