radeonsi: support for external buffers (ext_external_objects)
authorEleni Maria Stea <estea@igalia.com>
Tue, 22 Sep 2020 11:23:22 +0000 (14:23 +0300)
committerMarge Bot <eric+marge@anholt.net>
Thu, 1 Oct 2020 15:35:07 +0000 (15:35 +0000)
commit03af98abe26e738f2d4175a5e97dc9d62e386493
treeaea2a28228956cf7dd0e534503bf219a3262695b
parentdf6349159443dc365705d2363c1f5daaa387508e
radeonsi: support for external buffers (ext_external_objects)

So far, the callback to create a resource from a memory object had code
for importing textures only. Modified it to allow importing buffers too.

Fixes the following piglit tests:
- ext_external_objects/vk-buf-exchange
- ext_external_objects/vk-pix-buf-update-errors
- ext_external_objects/vk-vert-buf-update-errors
- ext_external_objects/vk-vert-buf-reuse

v2: Used si_alloc_buffer_struct instead of CALLOC
v3: Fixed indentation issue, removed free in case of unsuccessful
allocation, joined two if conditions together

Signed-off-by: Eleni Maria Stea <estea@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6364>
src/gallium/drivers/radeonsi/si_buffer.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_texture.c