From: Henri Verbeet Date: Mon, 7 Feb 2011 14:22:07 +0000 (+0100) Subject: r600g: Generalize the pipe_add_vertex_attrib() functions. X-Git-Tag: mesa-7.11-rc1~2252 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c59eebfae55240a2308c02b0a6ad971c9b83304;p=platform%2Fupstream%2Fmesa.git r600g: Generalize the pipe_add_vertex_attrib() functions. This allows them to be used for VS or PS buffer resources as well. --- diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 05539aa..bfa2199 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -1492,11 +1492,10 @@ void *evergreen_create_db_flush_dsa(struct r600_pipe_context *rctx) return rstate; } -void evergreen_pipe_add_vertex_attrib(struct r600_pipe_context *rctx, - struct r600_pipe_state *rstate, - unsigned index, - struct r600_resource *rbuffer, - unsigned offset, unsigned stride) +void evergreen_pipe_set_buffer_resource(struct r600_pipe_context *rctx, + struct r600_pipe_state *rstate, + struct r600_resource *rbuffer, + unsigned offset, unsigned stride) { r600_pipe_state_add_reg(rstate, R_030000_RESOURCE0_WORD0, offset, 0xFFFFFFFF, rbuffer->bo); @@ -1519,5 +1518,4 @@ void evergreen_pipe_add_vertex_attrib(struct r600_pipe_context *rctx, 0x00000000, 0xFFFFFFFF, NULL); r600_pipe_state_add_reg(rstate, R_03001C_RESOURCE0_WORD7, 0xC0000000, 0xFFFFFFFF, NULL); - evergreen_context_pipe_state_set_fs_resource(&rctx->ctx, rstate, index); } diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h index 6a09953..5f04fbf 100644 --- a/src/gallium/drivers/r600/r600_pipe.h +++ b/src/gallium/drivers/r600/r600_pipe.h @@ -168,11 +168,10 @@ void evergreen_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shader void evergreen_pipe_shader_vs(struct pipe_context *ctx, struct r600_pipe_shader *shader); void *evergreen_create_db_flush_dsa(struct r600_pipe_context *rctx); void evergreen_polygon_offset_update(struct r600_pipe_context *rctx); -void evergreen_pipe_add_vertex_attrib(struct r600_pipe_context *rctx, - struct r600_pipe_state *rstate, - unsigned index, - struct r600_resource *rbuffer, - unsigned offset, unsigned stride); +void evergreen_pipe_set_buffer_resource(struct r600_pipe_context *rctx, + struct r600_pipe_state *rstate, + struct r600_resource *rbuffer, + unsigned offset, unsigned stride); /* r600_blit.c */ void r600_init_blit_functions(struct r600_pipe_context *rctx); @@ -208,11 +207,10 @@ void r600_spi_update(struct r600_pipe_context *rctx); void r600_init_config(struct r600_pipe_context *rctx); void *r600_create_db_flush_dsa(struct r600_pipe_context *rctx); void r600_polygon_offset_update(struct r600_pipe_context *rctx); -void r600_pipe_add_vertex_attrib(struct r600_pipe_context *rctx, - struct r600_pipe_state *rstate, - unsigned index, - struct r600_resource *rbuffer, - unsigned offset, unsigned stride); +void r600_pipe_set_buffer_resource(struct r600_pipe_context *rctx, + struct r600_pipe_state *rstate, + struct r600_resource *rbuffer, + unsigned offset, unsigned stride); /* r600_helper.h */ int r600_conv_pipe_prim(unsigned pprim, unsigned *prim); diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index a51e7057..e4382ba 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -1218,11 +1218,10 @@ void *r600_create_db_flush_dsa(struct r600_pipe_context *rctx) return rstate; } -void r600_pipe_add_vertex_attrib(struct r600_pipe_context *rctx, - struct r600_pipe_state *rstate, - unsigned index, - struct r600_resource *rbuffer, - unsigned offset, unsigned stride) +void r600_pipe_set_buffer_resource(struct r600_pipe_context *rctx, + struct r600_pipe_state *rstate, + struct r600_resource *rbuffer, + unsigned offset, unsigned stride) { r600_pipe_state_add_reg(rstate, R_038000_RESOURCE0_WORD0, offset, 0xFFFFFFFF, rbuffer->bo); @@ -1239,5 +1238,4 @@ void r600_pipe_add_vertex_attrib(struct r600_pipe_context *rctx, 0x00000000, 0xFFFFFFFF, NULL); r600_pipe_state_add_reg(rstate, R_038018_RESOURCE0_WORD6, 0xC0000000, 0xFFFFFFFF, NULL); - r600_context_pipe_state_set_fs_resource(&rctx->ctx, rstate, index); } diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index b17686d..a2b2c17 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -398,13 +398,11 @@ static void r600_vertex_buffer_update(struct r600_pipe_context *rctx) offset += vertex_buffer->buffer_offset + r600_bo_offset(rbuffer->bo); if (rctx->family >= CHIP_CEDAR) { - evergreen_pipe_add_vertex_attrib(rctx, rstate, i, - rbuffer, offset, - vertex_buffer->stride); + evergreen_pipe_set_buffer_resource(rctx, rstate, rbuffer, offset, vertex_buffer->stride); + evergreen_context_pipe_state_set_fs_resource(&rctx->ctx, rstate, i); } else { - r600_pipe_add_vertex_attrib(rctx, rstate, i, - rbuffer, offset, - vertex_buffer->stride); + r600_pipe_set_buffer_resource(rctx, rstate, rbuffer, offset, vertex_buffer->stride); + r600_context_pipe_state_set_fs_resource(&rctx->ctx, rstate, i); } } }