diff options
author | Dave Airlie <[email protected]> | 2017-11-15 09:46:01 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-11-17 11:31:40 +1000 |
commit | 77d36cbc8de85ea5c4e8caf071cbc6661e0cd75c (patch) | |
tree | c904177aa5dc455f13398b2a3056448b72500d74 /src/gallium/drivers/r600/evergreen_state.c | |
parent | d8acf79f0c296d004977dc500ca1b6e7cd0b56da (diff) |
r600: handle writes_memory properly
This implements proper handling for shaders with side effects.
Tested-By: Gert Wollny <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/evergreen_state.c')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 2cd162629d2..c00114b6280 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -3173,8 +3173,12 @@ void evergreen_update_ps_state(struct pipe_context *ctx, struct r600_pipe_shader db_shader_control |= S_02880C_STENCIL_EXPORT_ENABLE(stencil_export); db_shader_control |= S_02880C_MASK_EXPORT_ENABLE(mask_export); - if (shader->selector->info.properties[TGSI_PROPERTY_FS_EARLY_DEPTH_STENCIL]) - db_shader_control |= S_02880C_DEPTH_BEFORE_SHADER(1); + if (shader->selector->info.properties[TGSI_PROPERTY_FS_EARLY_DEPTH_STENCIL]) { + db_shader_control |= S_02880C_DEPTH_BEFORE_SHADER(1) | + S_02880C_EXEC_ON_NOOP(shader->selector->info.writes_memory); + } else if (shader->selector->info.writes_memory) { + db_shader_control |= S_02880C_EXEC_ON_HIER_FAIL(1); + } switch (rshader->ps_conservative_z) { default: /* fall through */ @@ -3498,7 +3502,7 @@ void evergreen_update_db_shader_control(struct r600_context * rctx) * get a hang unless you flush the DB in between. For now just use * LATE_Z. */ - if (rctx->alphatest_state.sx_alpha_test_control) { + if (rctx->alphatest_state.sx_alpha_test_control || rctx->ps_shader->info.writes_memory) { db_shader_control |= S_02880C_Z_ORDER(V_02880C_LATE_Z); } else { db_shader_control |= S_02880C_Z_ORDER(V_02880C_EARLY_Z_THEN_LATE_Z); |