radeonsi: remove resource field from si_sampler_view
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sat, 6 Feb 2016 21:21:52 +0000 (16:21 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 9 Mar 2016 14:02:27 +0000 (15:02 +0100)
view->resource is redundant with view->base.texture, so get rid of it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state.c

index d030baca5318ed9555c120a1c10389cd0cb15fe3..37b9d68d4bea5d83cf7098eca682dd723f709dae 100644 (file)
@@ -191,7 +191,7 @@ static void si_set_sampler_view(struct si_context *sctx,
        if (view) {
                struct si_sampler_view *rview =
                        (struct si_sampler_view*)view;
-               struct r600_texture *rtex = (struct r600_texture*)view->texture;
+               struct r600_texture *rtex = (struct r600_texture *)view->texture;
 
                si_sampler_view_add_buffer(sctx, view->texture);
 
index 4d45e8ca3f1f05bc995a791b4ebbe14b48305802..736307b17a1e5064232895936e126b784b1163a0 100644 (file)
@@ -120,7 +120,6 @@ struct si_blend_color {
 struct si_sampler_view {
        struct pipe_sampler_view        base;
        struct list_head                list;
-       struct r600_resource            *resource;
         /* [0..7] = image descriptor
          * [4..7] = buffer descriptor */
        uint32_t                        state[8];
index c7be30a2967e12b9d255102df1f59f55f71e2a95..cc19f029e6d0eb80d2918b616e57dae3294031fc 100644 (file)
@@ -2843,7 +2843,6 @@ si_create_sampler_view_custom(struct pipe_context *ctx,
        }
 
        pipe_resource_reference(&view->base.texture, texture);
-       view->resource = &tmp->resource;
 
        if (state->format == PIPE_FORMAT_X24S8_UINT ||
            state->format == PIPE_FORMAT_S8X24_UINT ||
@@ -3135,7 +3134,7 @@ static void si_sampler_view_destroy(struct pipe_context *ctx,
 {
        struct si_sampler_view *view = (struct si_sampler_view *)state;
 
-       if (view->resource && view->resource->b.b.target == PIPE_BUFFER)
+       if (state->texture && state->texture->target == PIPE_BUFFER)
                LIST_DELINIT(&view->list);
 
        pipe_resource_reference(&state->texture, NULL);