diff options
author | Dave Airlie <[email protected]> | 2015-11-30 14:47:07 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2015-12-07 09:59:00 +1000 |
commit | 8874725c84d51b7828a25130a07ee3824c502822 (patch) | |
tree | 6c9cd96c8a21c91427f894b3a6af7a31bc463ce9 /src/gallium/drivers/r600 | |
parent | 79d88afd5c59b4d35c0277ca3886b061c8cfe761 (diff) |
r600: hook TES/TCS shaders to the selection logic.
This hooks the TES/TCS bindings to the HW stages up.
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r-- | src/gallium/drivers/r600/r600_state_common.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index 0c8ed524e76..de90a99ac1a 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -1411,6 +1411,7 @@ static bool r600_update_derived_state(struct r600_context *rctx) { struct pipe_context * ctx = (struct pipe_context*)rctx; bool ps_dirty = false, vs_dirty = false, gs_dirty = false; + bool tcs_dirty = false, tes_dirty = false; bool blend_disable; bool need_buf_const; struct r600_pipe_shader *clip_so_current = NULL; @@ -1432,11 +1433,25 @@ static bool r600_update_derived_state(struct r600_context *rctx) SELECT_SHADER_OR_FAIL(ps); + r600_mark_atom_dirty(rctx, &rctx->shader_stages.atom); + update_gs_block_state(rctx, rctx->gs_shader != NULL); if (rctx->gs_shader) SELECT_SHADER_OR_FAIL(gs); + /* Hull Shader */ + if (rctx->tcs_shader) { + SELECT_SHADER_OR_FAIL(tcs); + + UPDATE_SHADER(EG_HW_STAGE_HS, tcs); + } else + SET_NULL_SHADER(EG_HW_STAGE_HS); + + if (rctx->tes_shader) { + SELECT_SHADER_OR_FAIL(tes); + } + SELECT_SHADER_OR_FAIL(vs); if (rctx->gs_shader) { @@ -1449,8 +1464,16 @@ static bool r600_update_derived_state(struct r600_context *rctx) UPDATE_SHADER_GS(R600_HW_STAGE_GS, R600_HW_STAGE_VS, gs); /* vs_shader is used as ES */ - UPDATE_SHADER(R600_HW_STAGE_ES, vs); + if (rctx->tes_shader) { + /* VS goes to LS, TES goes to ES */ + UPDATE_SHADER(R600_HW_STAGE_ES, tes); + UPDATE_SHADER(EG_HW_STAGE_LS, vs); + } else { + /* vs_shader is used as ES */ + UPDATE_SHADER(R600_HW_STAGE_ES, vs); + SET_NULL_SHADER(EG_HW_STAGE_LS); + } } else { if (unlikely(rctx->hw_shader_stages[R600_HW_STAGE_GS].shader)) { SET_NULL_SHADER(R600_HW_STAGE_GS); @@ -1459,7 +1482,14 @@ static bool r600_update_derived_state(struct r600_context *rctx) r600_mark_atom_dirty(rctx, &rctx->shader_stages.atom); } - UPDATE_SHADER_CLIP(R600_HW_STAGE_VS, vs); + if (rctx->tes_shader) { + /* if TES is loaded and no geometry, TES runs on hw VS, VS runs on hw LS */ + UPDATE_SHADER_CLIP(R600_HW_STAGE_VS, tes); + UPDATE_SHADER(EG_HW_STAGE_LS, vs); + } else { + SET_NULL_SHADER(EG_HW_STAGE_LS); + UPDATE_SHADER_CLIP(R600_HW_STAGE_VS, vs); + } } /* Update clip misc state. */ |