[Mesa-dev] [PATCH 2/2] radeonsi: fix vertex element state
Christian König
deathsimple at vodafone.de
Mon Jul 16 03:14:28 PDT 2012
The vertex element state isn't in registers any more, so
remove that old code. That fixes a memory corruption with
the blend state and gets eglgears partially working.
Signed-off-by: Christian König <deathsimple at vodafone.de>
---
src/gallium/drivers/radeonsi/r600_state_common.c | 32 ++++------------------
src/gallium/drivers/radeonsi/radeonsi_pipe.h | 7 -----
2 files changed, 6 insertions(+), 33 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/r600_state_common.c b/src/gallium/drivers/radeonsi/r600_state_common.c
index 05b7946..b63027e 100644
--- a/src/gallium/drivers/radeonsi/r600_state_common.c
+++ b/src/gallium/drivers/radeonsi/r600_state_common.c
@@ -279,9 +279,6 @@ void r600_bind_vertex_elements(struct pipe_context *ctx, void *state)
rctx->vertex_elements = v;
if (v) {
r600_inval_shader_cache(rctx);
-
- rctx->states[v->rstate.id] = &v->rstate;
- r600_context_pipe_state_set(rctx, &v->rstate);
}
}
@@ -290,9 +287,6 @@ void r600_delete_vertex_element(struct pipe_context *ctx, void *state)
struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_vertex_element *v = (struct r600_vertex_element*)state;
- if (rctx->states[v->rstate.id] == &v->rstate) {
- rctx->states[v->rstate.id] = NULL;
- }
if (rctx->vertex_elements == state)
rctx->vertex_elements = NULL;
FREE(state);
@@ -558,13 +552,8 @@ static void r600_vertex_buffer_update(struct r600_context *rctx)
r600_inval_vertex_cache(rctx);
- if (rctx->vertex_elements->vbuffer_need_offset) {
- /* one resource per vertex elements */
- count = rctx->vertex_elements->count;
- } else {
- /* bind vertex buffer once */
- count = rctx->nr_vertex_buffers;
- }
+ /* bind vertex buffer once */
+ count = rctx->nr_vertex_buffers;
assert(count <= 256 / 4);
t_list_buffer = (struct r600_resource*)
@@ -583,19 +572,10 @@ static void r600_vertex_buffer_update(struct r600_context *rctx)
unsigned data_format, num_format;
int first_non_void;
- if (rctx->vertex_elements->vbuffer_need_offset) {
- /* one resource per vertex elements */
- unsigned vbuffer_index;
- vbuffer_index = rctx->vertex_elements->elements[i].vertex_buffer_index;
- vertex_buffer = &rctx->vertex_buffer[vbuffer_index];
- rbuffer = (struct r600_resource*)vertex_buffer->buffer;
- offset = rctx->vertex_elements->vbuffer_offset[i];
- } else {
- /* bind vertex buffer once */
- vertex_buffer = &rctx->vertex_buffer[i];
- rbuffer = (struct r600_resource*)vertex_buffer->buffer;
- offset = 0;
- }
+ /* bind vertex buffer once */
+ vertex_buffer = &rctx->vertex_buffer[i];
+ rbuffer = (struct r600_resource*)vertex_buffer->buffer;
+ offset = 0;
if (vertex_buffer == NULL || rbuffer == NULL)
continue;
offset += vertex_buffer->buffer_offset;
diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.h b/src/gallium/drivers/radeonsi/radeonsi_pipe.h
index 7d6b13a..6ba1017 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_pipe.h
+++ b/src/gallium/drivers/radeonsi/radeonsi_pipe.h
@@ -156,13 +156,6 @@ struct r600_vertex_element
{
unsigned count;
struct pipe_vertex_element elements[PIPE_MAX_ATTRIBS];
- unsigned fs_size;
- struct r600_pipe_state rstate;
- /* if offset is to big for fetch instructio we need to alterate
- * offset of vertex buffer, record here the offset need to add
- */
- unsigned vbuffer_need_offset;
- unsigned vbuffer_offset[PIPE_MAX_ATTRIBS];
};
struct r600_shader_io {
--
1.7.9.5
More information about the mesa-dev
mailing list