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 <deathsimple@vodafone.de> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
parent
4247fd9928
commit
89e755d762
|
@ -279,9 +279,6 @@ void r600_bind_vertex_elements(struct pipe_context *ctx, void *state)
|
||||||
rctx->vertex_elements = v;
|
rctx->vertex_elements = v;
|
||||||
if (v) {
|
if (v) {
|
||||||
r600_inval_shader_cache(rctx);
|
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_context *rctx = (struct r600_context *)ctx;
|
||||||
struct r600_vertex_element *v = (struct r600_vertex_element*)state;
|
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)
|
if (rctx->vertex_elements == state)
|
||||||
rctx->vertex_elements = NULL;
|
rctx->vertex_elements = NULL;
|
||||||
FREE(state);
|
FREE(state);
|
||||||
|
@ -558,13 +552,8 @@ static void r600_vertex_buffer_update(struct r600_context *rctx)
|
||||||
|
|
||||||
r600_inval_vertex_cache(rctx);
|
r600_inval_vertex_cache(rctx);
|
||||||
|
|
||||||
if (rctx->vertex_elements->vbuffer_need_offset) {
|
/* bind vertex buffer once */
|
||||||
/* one resource per vertex elements */
|
count = rctx->nr_vertex_buffers;
|
||||||
count = rctx->vertex_elements->count;
|
|
||||||
} else {
|
|
||||||
/* bind vertex buffer once */
|
|
||||||
count = rctx->nr_vertex_buffers;
|
|
||||||
}
|
|
||||||
assert(count <= 256 / 4);
|
assert(count <= 256 / 4);
|
||||||
|
|
||||||
t_list_buffer = (struct r600_resource*)
|
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;
|
unsigned data_format, num_format;
|
||||||
int first_non_void;
|
int first_non_void;
|
||||||
|
|
||||||
if (rctx->vertex_elements->vbuffer_need_offset) {
|
/* bind vertex buffer once */
|
||||||
/* one resource per vertex elements */
|
vertex_buffer = &rctx->vertex_buffer[i];
|
||||||
unsigned vbuffer_index;
|
rbuffer = (struct r600_resource*)vertex_buffer->buffer;
|
||||||
vbuffer_index = rctx->vertex_elements->elements[i].vertex_buffer_index;
|
offset = 0;
|
||||||
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;
|
|
||||||
}
|
|
||||||
if (vertex_buffer == NULL || rbuffer == NULL)
|
if (vertex_buffer == NULL || rbuffer == NULL)
|
||||||
continue;
|
continue;
|
||||||
offset += vertex_buffer->buffer_offset;
|
offset += vertex_buffer->buffer_offset;
|
||||||
|
|
|
@ -156,13 +156,6 @@ struct r600_vertex_element
|
||||||
{
|
{
|
||||||
unsigned count;
|
unsigned count;
|
||||||
struct pipe_vertex_element elements[PIPE_MAX_ATTRIBS];
|
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 {
|
struct r600_shader_io {
|
||||||
|
|
Loading…
Reference in New Issue