gallium/radeon: disallow handle export for MSAA & depth textures
authorMarek Olšák <marek.olsak@amd.com>
Wed, 24 Feb 2016 19:17:50 +0000 (20:17 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 9 Mar 2016 14:02:27 +0000 (15:02 +0100)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_texture.c

index 8fc236e..21bb3f9 100644 (file)
@@ -259,6 +259,13 @@ static boolean r600_texture_get_handle(struct pipe_screen* screen,
        struct r600_texture *rtex = (struct r600_texture*)resource;
        struct radeon_bo_metadata metadata;
 
+       /* This is not supported now, but it might be required for OpenCL
+        * interop in the future.
+        */
+       if (resource->target != PIPE_BUFFER &&
+           (resource->nr_samples > 1 || rtex->is_depth))
+               return NULL;
+
        if (!res->is_shared) {
                res->is_shared = true;
                res->external_usage = usage;