summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian König <[email protected]>2012-07-16 12:07:54 +0200
committerChristian König <[email protected]>2012-07-17 10:44:12 +0200
commit89e755d7621a15fbf8ad32e6c7b82d4d0ff5b993 (patch)
tree006a310fb8a09e9dd54f7416b3c4ee913120d0c1 /src
parent4247fd9928b0301a300c0e1e14ed45560e0afc33 (diff)
radeonsi: fix vertex element state
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 <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeonsi/r600_state_common.c32
-rw-r--r--src/gallium/drivers/radeonsi/radeonsi_pipe.h7
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 05b7946512f..b63027e9c38 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 7d6b13a4683..6ba1017e16d 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 {