diff options
author | Dave Airlie <[email protected]> | 2015-11-24 06:48:20 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2015-11-30 09:14:16 +1000 |
commit | b502bae610a9f302bf69cd81a8631b8b675c231f (patch) | |
tree | 69f557a76c3e357cc245df49eca58d45fdc36b5b /src | |
parent | b8c524ff88499f64c94f1d1c41671107f98f991a (diff) |
r600: consolidate clip state updates
Move some common code into one place, tess will also need
to use this function.
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/r600/r600_state_common.c | 31 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600d.h | 2 |
2 files changed, 16 insertions, 17 deletions
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index d629194ca6e..4ea122a1136 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -1276,6 +1276,19 @@ static void update_gs_block_state(struct r600_context *rctx, unsigned enable) } } +static void r600_update_clip_state(struct r600_context *rctx, + struct r600_pipe_shader *current) +{ + if (current->pa_cl_vs_out_cntl != rctx->clip_misc_state.pa_cl_vs_out_cntl || + current->shader.clip_dist_write != rctx->clip_misc_state.clip_dist_write || + current->shader.vs_position_window_space != rctx->clip_misc_state.clip_disable) { + rctx->clip_misc_state.pa_cl_vs_out_cntl = current->pa_cl_vs_out_cntl; + rctx->clip_misc_state.clip_dist_write = current->shader.clip_dist_write; + rctx->clip_misc_state.clip_disable = current->shader.vs_position_window_space; + r600_mark_atom_dirty(rctx, &rctx->clip_misc_state.atom); + } +} + static bool r600_update_derived_state(struct r600_context *rctx) { struct pipe_context * ctx = (struct pipe_context*)rctx; @@ -1318,14 +1331,7 @@ static bool r600_update_derived_state(struct r600_context *rctx) update_shader_atom(ctx, &rctx->geometry_shader, rctx->gs_shader->current); update_shader_atom(ctx, &rctx->vertex_shader, rctx->gs_shader->current->gs_copy_shader); /* Update clip misc state. */ - if (rctx->gs_shader->current->gs_copy_shader->pa_cl_vs_out_cntl != rctx->clip_misc_state.pa_cl_vs_out_cntl || - rctx->gs_shader->current->gs_copy_shader->shader.clip_dist_write != rctx->clip_misc_state.clip_dist_write || - rctx->clip_misc_state.clip_disable != rctx->gs_shader->current->shader.vs_position_window_space) { - rctx->clip_misc_state.pa_cl_vs_out_cntl = rctx->gs_shader->current->gs_copy_shader->pa_cl_vs_out_cntl; - rctx->clip_misc_state.clip_dist_write = rctx->gs_shader->current->gs_copy_shader->shader.clip_dist_write; - rctx->clip_misc_state.clip_disable = rctx->gs_shader->current->shader.vs_position_window_space; - r600_mark_atom_dirty(rctx, &rctx->clip_misc_state.atom); - } + r600_update_clip_state(rctx, rctx->gs_shader->current->gs_copy_shader); rctx->b.streamout.enabled_stream_buffers_mask = rctx->gs_shader->current->gs_copy_shader->enabled_stream_buffers_mask; } @@ -1353,14 +1359,7 @@ static bool r600_update_derived_state(struct r600_context *rctx) update_shader_atom(ctx, &rctx->vertex_shader, rctx->vs_shader->current); /* Update clip misc state. */ - if (rctx->vs_shader->current->pa_cl_vs_out_cntl != rctx->clip_misc_state.pa_cl_vs_out_cntl || - rctx->vs_shader->current->shader.clip_dist_write != rctx->clip_misc_state.clip_dist_write || - rctx->clip_misc_state.clip_disable != rctx->vs_shader->current->shader.vs_position_window_space) { - rctx->clip_misc_state.pa_cl_vs_out_cntl = rctx->vs_shader->current->pa_cl_vs_out_cntl; - rctx->clip_misc_state.clip_dist_write = rctx->vs_shader->current->shader.clip_dist_write; - rctx->clip_misc_state.clip_disable = rctx->vs_shader->current->shader.vs_position_window_space; - r600_mark_atom_dirty(rctx, &rctx->clip_misc_state.atom); - } + r600_update_clip_state(rctx, rctx->vs_shader->current); rctx->b.streamout.enabled_stream_buffers_mask = rctx->vs_shader->current->enabled_stream_buffers_mask; } } diff --git a/src/gallium/drivers/r600/r600d.h b/src/gallium/drivers/r600/r600d.h index 53f5ad6db6a..d4df0606e56 100644 --- a/src/gallium/drivers/r600/r600d.h +++ b/src/gallium/drivers/r600/r600d.h @@ -1367,7 +1367,7 @@ #define V_008958_DI_PT_TRISTRIP 0x00000006 #define V_008958_DI_PT_UNUSED_0 0x00000007 #define V_008958_DI_PT_UNUSED_1 0x00000008 -#define V_008958_DI_PT_UNUSED_2 0x00000009 +#define V_008958_DI_PT_PATCH 0x00000009 #define V_008958_DI_PT_LINELIST_ADJ 0x0000000A #define V_008958_DI_PT_LINESTRIP_ADJ 0x0000000B #define V_008958_DI_PT_TRILIST_ADJ 0x0000000C |