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_state.c | |
parent | abc2f29dd2baa9c8aa672f07a1500e579364ab29 (diff) |
r300g: atomize VS constant buffer
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index a732ef3a104..a10953c04ae 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1383,9 +1383,14 @@ static void r300_bind_vs_state(struct pipe_context* pipe, void* shader) vs->code.length + 9 + (vs->immediates_count ? vs->immediates_count * 4 + 3 : 0); - r300->pvs_flush.dirty = TRUE; + if (vs->externals_count) { + r300->vs_constants.dirty = TRUE; + r300->vs_constants.size = vs->externals_count * 4 + 3; + } else { + r300->vs_constants.size = 0; + } - r300->dirty_state |= R300_NEW_VERTEX_SHADER_CONSTANTS; + r300->pvs_flush.dirty = TRUE; } else { draw_flush(r300->draw); draw_bind_vertex_shader(r300->draw, @@ -1421,7 +1426,7 @@ static void r300_set_constant_buffer(struct pipe_context *pipe, switch (shader) { case PIPE_SHADER_VERTEX: - cbuf = &r300->shader_constants[PIPE_SHADER_VERTEX]; + cbuf = (struct r300_constant_buffer*)r300->vs_constants.state; max_size = 256; break; case PIPE_SHADER_FRAGMENT: @@ -1434,7 +1439,7 @@ static void r300_set_constant_buffer(struct pipe_context *pipe, break; default: assert(0); - cbuf = NULL; + return; } if (buf == NULL || buf->width0 == 0 || @@ -1460,7 +1465,9 @@ static void r300_set_constant_buffer(struct pipe_context *pipe, if (shader == PIPE_SHADER_VERTEX) { if (r300->screen->caps.has_tcl) { - r300->dirty_state |= R300_NEW_VERTEX_SHADER_CONSTANTS; + if (r300->vs_constants.size) { + r300->vs_constants.dirty = TRUE; + } r300->pvs_flush.dirty = TRUE; } else if (r300->draw) { draw_set_mapped_constant_buffer(r300->draw, PIPE_SHADER_VERTEX, |