From 3da70606b3af1e907d56666d199957b6da0c73fe Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 14 Apr 2010 04:12:08 +0200 Subject: r300g: atomize VS constant buffer --- src/gallium/drivers/r300/r300_emit.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/gallium/drivers/r300/r300_emit.c') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index b337cd96036..afb47ead9c5 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -1025,21 +1025,25 @@ void r300_emit_vs_state(struct r300_context* r300, unsigned size, void* state) END_CS; } -void r300_emit_vs_constant_buffer(struct r300_context* r300, - struct rc_constant_list* constants) +void r300_emit_vs_constants(struct r300_context* r300, + unsigned size, void *state) { unsigned i; - unsigned count = ((struct r300_vertex_shader*)r300->vs_state.state)->externals_count; + unsigned count = + ((struct r300_vertex_shader*)r300->vs_state.state)->externals_count; + struct r300_constant_buffer *buf = (struct r300_constant_buffer*)state; CS_LOCALS(r300); - BEGIN_CS(count * 4 + 3); + if (!count) + return; + + BEGIN_CS(size); OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, (r300->screen->caps.is_r500 ? R500_PVS_CONST_START : R300_PVS_CONST_START)); OUT_CS_ONE_REG(R300_VAP_PVS_UPLOAD_DATA, count * 4); for (i = 0; i < count; i++) { - const float *data = - r300->shader_constants[PIPE_SHADER_VERTEX].constants[i]; + const float *data = buf->constants[i]; OUT_CS_32F(data[0]); OUT_CS_32F(data[1]); OUT_CS_32F(data[2]); @@ -1227,14 +1231,6 @@ void r300_emit_dirty_state(struct r300_context* r300) } } - if (r300->dirty_state & R300_NEW_VERTEX_SHADER_CONSTANTS) { - struct r300_vertex_shader* vs = r300->vs_state.state; - if (vs->code.constants.Count) { - r300_emit_vs_constant_buffer(r300, &vs->code.constants); - } - r300->dirty_state &= ~R300_NEW_VERTEX_SHADER_CONSTANTS; - } - /* Emit the VBO for SWTCL. */ if (!r300screen->caps.has_tcl) { r300_emit_vertex_buffer(r300); -- cgit v1.2.3