gallium/radeon: clean up r600_texture_get_handle
authorMarek Olšák <marek.olsak@amd.com>
Wed, 24 Feb 2016 16:30:09 +0000 (17:30 +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 33f4042bee5cff2bf8d633b319d977c508aa1639..377dd3de57846def5443b2a9249f4dfdbbc87f34 100644 (file)
@@ -250,21 +250,21 @@ static void r600_texture_init_metadata(struct r600_texture *rtex,
 }
 
 static boolean r600_texture_get_handle(struct pipe_screen* screen,
-                                      struct pipe_resource *ptex,
+                                      struct pipe_resource *resource,
                                       struct winsys_handle *whandle,
                                        unsigned usage)
 {
-       struct r600_texture *rtex = (struct r600_texture*)ptex;
-       struct r600_resource *resource = &rtex->resource;
-       struct radeon_surf *surface = &rtex->surface;
        struct r600_common_screen *rscreen = (struct r600_common_screen*)screen;
+       struct r600_resource *res = (struct r600_resource*)resource;
+       struct r600_texture *rtex = (struct r600_texture*)resource;
        struct radeon_bo_metadata metadata;
 
        r600_texture_init_metadata(rtex, &metadata);
-       rscreen->ws->buffer_set_metadata(resource->buf, &metadata);
+       rscreen->ws->buffer_set_metadata(res->buf, &metadata);
 
-       return rscreen->ws->buffer_get_handle(resource->buf,
-                                               surface->level[0].pitch_bytes, whandle);
+       return rscreen->ws->buffer_get_handle(res->buf,
+                                             rtex->surface.level[0].pitch_bytes,
+                                             whandle);
 }
 
 static void r600_texture_destroy(struct pipe_screen *screen,