diff options
author | Marek Olšák <[email protected]> | 2011-04-05 17:57:02 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-04-05 19:25:25 +0200 |
commit | 4af3fe857dc07923af8786b434dee32d493b577e (patch) | |
tree | d1189d0cabb55b1fccceea76825983d4dd136892 /src/gallium/drivers/r300/r300_state.c | |
parent | d8361400b76dde6fb63df6c363b7dd59c5946e09 (diff) |
r300g: postpone fragment shader state validation until draw_vbo
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 890e3961b18..61d6751e5d3 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -969,24 +969,14 @@ static void r300_bind_fs_state(struct pipe_context* pipe, void* shader) { struct r300_context* r300 = r300_context(pipe); struct r300_fragment_shader* fs = (struct r300_fragment_shader*)shader; - struct pipe_framebuffer_state *fb = r300->fb_state.state; - boolean last_multi_write; if (fs == NULL) { r300->fs.state = NULL; return; } - last_multi_write = r300_fragment_shader_writes_all(r300_fs(r300)); - r300->fs.state = fs; - r300_pick_fragment_shader(r300); - r300_mark_fs_code_dirty(r300); - - if (fb->nr_cbufs > 1 && - last_multi_write != r300_fragment_shader_writes_all(fs)) { - r300_mark_fb_state_dirty(r300, R300_CHANGED_MULTIWRITE); - } + r300->fs_status = FRAGMENT_SHADER_DIRTY; r300_mark_atom_dirty(r300, &r300->rs_block_state); /* Will be updated before the emission. */ } @@ -1256,8 +1246,8 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state) } if (last_frag_clamp != r300->frag_clamp && - r300->fs.state && r300_pick_fragment_shader(r300)) { - r300_mark_fs_code_dirty(r300); + r300->fs_status == FRAGMENT_SHADER_VALID) { + r300->fs_status = FRAGMENT_SHADER_MAYBE_DIRTY; } } @@ -1555,7 +1545,8 @@ static void r300_set_viewport_state(struct pipe_context* pipe, } r300_mark_atom_dirty(r300, &r300->viewport_state); - if (r300->fs.state && r300_fs(r300)->shader->inputs.wpos != ATTR_UNUSED) { + if (r300->fs.state && r300_fs(r300)->shader && + r300_fs(r300)->shader->inputs.wpos != ATTR_UNUSED) { r300_mark_atom_dirty(r300, &r300->fs_rc_constant_state); } } |