[Mesa-dev] [PATCH 22/26] radeonsi: remove resource field from si_sampler_view

Marek Olšák maraeo at gmail.com
Wed Mar 2 16:36:31 UTC 2016


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

view->resource is redundant with view->base.texture, so get rid of it.
---
 src/gallium/drivers/radeonsi/si_descriptors.c | 2 +-
 src/gallium/drivers/radeonsi/si_pipe.h        | 1 -
 src/gallium/drivers/radeonsi/si_state.c       | 3 +--
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index d030bac..37b9d68 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -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);
 
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index 4d45e8c..736307b 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -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];
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 1957045..9c51e5c 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2847,7 +2847,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 ||
@@ -3139,7 +3138,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);
-- 
2.5.0



More information about the mesa-dev mailing list