diff options
author | Marek Olšák <[email protected]> | 2010-04-14 04:12:08 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-04-14 04:48:19 +0200 |
commit | 3da70606b3af1e907d56666d199957b6da0c73fe (patch) | |
tree | 0505ae4add95f4e31d2b13b588b4757e4a0c116b /src/gallium/drivers/r300/r300_emit.c | |
parent | abc2f29dd2baa9c8aa672f07a1500e579364ab29 (diff) |
r300g: atomize VS constant buffer
Diffstat (limited to 'src/gallium/drivers/r300/r300_emit.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_emit.c | 24 |
1 files changed, 10 insertions, 14 deletions
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); |