r600g: Generalize the pipe_add_vertex_attrib() functions.
This allows them to be used for VS or PS buffer resources as well.
This commit is contained in:
parent
b9fd1a1e4b
commit
5c59eebfae
|
@ -1492,9 +1492,8 @@ void *evergreen_create_db_flush_dsa(struct r600_pipe_context *rctx)
|
||||||
return rstate;
|
return rstate;
|
||||||
}
|
}
|
||||||
|
|
||||||
void evergreen_pipe_add_vertex_attrib(struct r600_pipe_context *rctx,
|
void evergreen_pipe_set_buffer_resource(struct r600_pipe_context *rctx,
|
||||||
struct r600_pipe_state *rstate,
|
struct r600_pipe_state *rstate,
|
||||||
unsigned index,
|
|
||||||
struct r600_resource *rbuffer,
|
struct r600_resource *rbuffer,
|
||||||
unsigned offset, unsigned stride)
|
unsigned offset, unsigned stride)
|
||||||
{
|
{
|
||||||
|
@ -1519,5 +1518,4 @@ void evergreen_pipe_add_vertex_attrib(struct r600_pipe_context *rctx,
|
||||||
0x00000000, 0xFFFFFFFF, NULL);
|
0x00000000, 0xFFFFFFFF, NULL);
|
||||||
r600_pipe_state_add_reg(rstate, R_03001C_RESOURCE0_WORD7,
|
r600_pipe_state_add_reg(rstate, R_03001C_RESOURCE0_WORD7,
|
||||||
0xC0000000, 0xFFFFFFFF, NULL);
|
0xC0000000, 0xFFFFFFFF, NULL);
|
||||||
evergreen_context_pipe_state_set_fs_resource(&rctx->ctx, rstate, index);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,9 +168,8 @@ 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_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_create_db_flush_dsa(struct r600_pipe_context *rctx);
|
||||||
void evergreen_polygon_offset_update(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,
|
void evergreen_pipe_set_buffer_resource(struct r600_pipe_context *rctx,
|
||||||
struct r600_pipe_state *rstate,
|
struct r600_pipe_state *rstate,
|
||||||
unsigned index,
|
|
||||||
struct r600_resource *rbuffer,
|
struct r600_resource *rbuffer,
|
||||||
unsigned offset, unsigned stride);
|
unsigned offset, unsigned stride);
|
||||||
|
|
||||||
|
@ -208,9 +207,8 @@ void r600_spi_update(struct r600_pipe_context *rctx);
|
||||||
void r600_init_config(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_create_db_flush_dsa(struct r600_pipe_context *rctx);
|
||||||
void r600_polygon_offset_update(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,
|
void r600_pipe_set_buffer_resource(struct r600_pipe_context *rctx,
|
||||||
struct r600_pipe_state *rstate,
|
struct r600_pipe_state *rstate,
|
||||||
unsigned index,
|
|
||||||
struct r600_resource *rbuffer,
|
struct r600_resource *rbuffer,
|
||||||
unsigned offset, unsigned stride);
|
unsigned offset, unsigned stride);
|
||||||
|
|
||||||
|
|
|
@ -1218,9 +1218,8 @@ void *r600_create_db_flush_dsa(struct r600_pipe_context *rctx)
|
||||||
return rstate;
|
return rstate;
|
||||||
}
|
}
|
||||||
|
|
||||||
void r600_pipe_add_vertex_attrib(struct r600_pipe_context *rctx,
|
void r600_pipe_set_buffer_resource(struct r600_pipe_context *rctx,
|
||||||
struct r600_pipe_state *rstate,
|
struct r600_pipe_state *rstate,
|
||||||
unsigned index,
|
|
||||||
struct r600_resource *rbuffer,
|
struct r600_resource *rbuffer,
|
||||||
unsigned offset, unsigned stride)
|
unsigned offset, unsigned stride)
|
||||||
{
|
{
|
||||||
|
@ -1239,5 +1238,4 @@ void r600_pipe_add_vertex_attrib(struct r600_pipe_context *rctx,
|
||||||
0x00000000, 0xFFFFFFFF, NULL);
|
0x00000000, 0xFFFFFFFF, NULL);
|
||||||
r600_pipe_state_add_reg(rstate, R_038018_RESOURCE0_WORD6,
|
r600_pipe_state_add_reg(rstate, R_038018_RESOURCE0_WORD6,
|
||||||
0xC0000000, 0xFFFFFFFF, NULL);
|
0xC0000000, 0xFFFFFFFF, NULL);
|
||||||
r600_context_pipe_state_set_fs_resource(&rctx->ctx, rstate, index);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
offset += vertex_buffer->buffer_offset + r600_bo_offset(rbuffer->bo);
|
||||||
|
|
||||||
if (rctx->family >= CHIP_CEDAR) {
|
if (rctx->family >= CHIP_CEDAR) {
|
||||||
evergreen_pipe_add_vertex_attrib(rctx, rstate, i,
|
evergreen_pipe_set_buffer_resource(rctx, rstate, rbuffer, offset, vertex_buffer->stride);
|
||||||
rbuffer, offset,
|
evergreen_context_pipe_state_set_fs_resource(&rctx->ctx, rstate, i);
|
||||||
vertex_buffer->stride);
|
|
||||||
} else {
|
} else {
|
||||||
r600_pipe_add_vertex_attrib(rctx, rstate, i,
|
r600_pipe_set_buffer_resource(rctx, rstate, rbuffer, offset, vertex_buffer->stride);
|
||||||
rbuffer, offset,
|
r600_context_pipe_state_set_fs_resource(&rctx->ctx, rstate, i);
|
||||||
vertex_buffer->stride);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue