radv: Don't segfault when exporting an image which hasn't been bound yet.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 23 Jul 2017 22:39:51 +0000 (00:39 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 23 Jul 2017 23:50:52 +0000 (01:50 +0200)
commitdaaf7efb93f433fbc82ee1a7adaf663cb4f96337
tree646828cc8721cdce58c95a9d19440d9ca28d8963
parentea08a296fe226f5e67366b4db420c2322f38774c
radv: Don't segfault when exporting an image which hasn't been bound yet.

The image is set on Memory allocation already, but the image doesn't
have to have the BindImageMemory called yet. Luckily, we know offset
within a BO has to be 0 for dedicated allocations, so we can just
use the dummy 0 in the address calaculations.

Fixes CTS test dEQP-VK.api.external.memory.opaque_fd.dedicated.image.export_bind_import_bind

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Fixes: b70829708ac "radv: Implement VK_KHR_external_memory"
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_image.c