gallium/radeon: don't set texture metadata for buffers
authorMarek Olšák <marek.olsak@amd.com>
Wed, 24 Feb 2016 16:33:28 +0000 (17:33 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 9 Mar 2016 14:02:26 +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 5e77080eed21757d1b18af0e61c4ab35f8bc29d7..558dc73d9d40d9e6c519ac3b954d4bad5131caed 100644 (file)
@@ -261,8 +261,11 @@ static boolean r600_texture_get_handle(struct pipe_screen* screen,
 
        if (!res->is_shared) {
                res->is_shared = true;
-               r600_texture_init_metadata(rtex, &metadata);
-               rscreen->ws->buffer_set_metadata(res->buf, &metadata);
+
+               if (resource->target != PIPE_BUFFER) {
+                       r600_texture_init_metadata(rtex, &metadata);
+                       rscreen->ws->buffer_set_metadata(res->buf, &metadata);
+               }
        }
 
        return rscreen->ws->buffer_get_handle(res->buf,