Mesa (master): r600g: Remove vs_resource and ps_resource from the pipe context.

Henri Verbeet hverbeet at kemper.freedesktop.org
Mon Feb 7 14:24:46 UTC 2011


Module: Mesa
Branch: master
Commit: b9fd1a1e4b2121225195056ea1b679d62c399ddb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b9fd1a1e4b2121225195056ea1b679d62c399ddb

Author: Henri Verbeet <hverbeet at gmail.com>
Date:   Mon Feb  7 15:22:07 2011 +0100

r600g: Remove vs_resource and ps_resource from the pipe context.

These are practically unused, only the vs_resource array is being abused for
fetch shader resources.

---

 src/gallium/drivers/r600/r600_pipe.c         |   14 --------------
 src/gallium/drivers/r600/r600_pipe.h         |    4 +---
 src/gallium/drivers/r600/r600_state_common.c |   10 +++++-----
 3 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 04bbcf5..48ff95b 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -88,8 +88,6 @@ static void r600_destroy_context(struct pipe_context *context)
 	u_upload_destroy(rctx->upload_const);
 	u_vbuf_mgr_destroy(rctx->vbuf_mgr);
 
-	FREE(rctx->ps_resource);
-	FREE(rctx->vs_resource);
 	FREE(rctx);
 }
 
@@ -187,18 +185,6 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
 		return NULL;
 	}
 
-	rctx->vs_resource = CALLOC(R600_RESOURCE_ARRAY_SIZE, sizeof(struct r600_pipe_state));
-	if (!rctx->vs_resource) {
-		FREE(rctx);
-		return NULL;
-	}
-
-	rctx->ps_resource = CALLOC(R600_RESOURCE_ARRAY_SIZE, sizeof(struct r600_pipe_state));
-	if (!rctx->ps_resource) {
-		FREE(rctx);
-		return NULL;
-	}
-
 	class = r600_get_family_class(rctx->radeon);
 	if (class == R600 || class == R700)
 		rctx->custom_dsa_flush = r600_create_db_flush_dsa(rctx);
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index e9820a2..6a09953 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -128,6 +128,7 @@ struct r600_pipe_context {
 	struct r600_pipe_state		*states[R600_PIPE_NSTATES];
 	struct r600_context		ctx;
 	struct r600_vertex_element	*vertex_elements;
+	struct r600_pipe_state		fs_resource[PIPE_MAX_ATTRIBS];
 	struct pipe_framebuffer_state	framebuffer;
 	struct pipe_index_buffer	index_buffer;
 	unsigned			cb_target_mask;
@@ -135,9 +136,6 @@ struct r600_pipe_context {
 	struct pipe_stencil_ref		stencil_ref;
 	struct pipe_viewport_state	viewport;
 	struct pipe_clip_state		clip;
-	unsigned			nvs_resource;
-	struct r600_pipe_state		*vs_resource;
-	struct r600_pipe_state		*ps_resource;
 	struct r600_pipe_state		config;
 	struct r600_pipe_shader 	*ps_shader;
 	struct r600_pipe_shader 	*vs_shader;
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 3a95946..b17686d 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -365,18 +365,18 @@ static void r600_vertex_buffer_update(struct r600_pipe_context *rctx)
 	struct r600_pipe_state *rstate;
 	struct r600_resource *rbuffer;
 	struct pipe_vertex_buffer *vertex_buffer;
-	unsigned i, offset;
+	unsigned i, count, offset;
 
 	if (rctx->vertex_elements->vbuffer_need_offset) {
 		/* one resource per vertex elements */
-		rctx->nvs_resource = rctx->vertex_elements->count;
+		count = rctx->vertex_elements->count;
 	} else {
 		/* bind vertex buffer once */
-		rctx->nvs_resource = rctx->vbuf_mgr->nr_real_vertex_buffers;
+		count = rctx->vbuf_mgr->nr_real_vertex_buffers;
 	}
 
-	for (i = 0 ; i < rctx->nvs_resource; i++) {
-		rstate = &rctx->vs_resource[i];
+	for (i = 0 ; i < count; i++) {
+		rstate = &rctx->fs_resource[i];
 		rstate->id = R600_PIPE_STATE_RESOURCE;
 		rstate->nregs = 0;
 




More information about the mesa-commit mailing list