anv: Add a new bo_pool_init helper
This ensures that we're always setting all of the fields in anv_bo Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
@@ -1146,15 +1146,11 @@ VkResult anv_DeviceWaitIdle(
|
||||
VkResult
|
||||
anv_bo_init_new(struct anv_bo *bo, struct anv_device *device, uint64_t size)
|
||||
{
|
||||
bo->gem_handle = anv_gem_create(device, size);
|
||||
if (!bo->gem_handle)
|
||||
uint32_t gem_handle = anv_gem_create(device, size);
|
||||
if (!gem_handle)
|
||||
return vk_error(VK_ERROR_OUT_OF_DEVICE_MEMORY);
|
||||
|
||||
bo->map = NULL;
|
||||
bo->index = 0;
|
||||
bo->offset = 0;
|
||||
bo->size = size;
|
||||
bo->is_winsys_bo = false;
|
||||
anv_bo_init(bo, gem_handle, size);
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user