diff options
author | Marek Olšák <marek.olsak@amd.com> | 2016-11-13 17:51:41 +0100 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2016-11-21 21:44:35 +0100 |
commit | 9d8db805ef6d10bc3b7c6a91963c86ab3874ebf8 (patch) | |
tree | 4f819c1c8975f682685257e60034333593969d97 /src/gallium/drivers/radeonsi | |
parent | e59389d73826c88c76c7a4db2a7ca5ef57bdf7b9 (diff) |
radeonsi: clean up si_emit_clip_regs
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 818a393f4d5..3ca3553e733 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -645,10 +645,12 @@ static void si_emit_clip_regs(struct si_context *sctx, struct r600_atom *atom) { struct radeon_winsys_cs *cs = sctx->b.gfx.cs; struct tgsi_shader_info *info = si_get_vs_info(sctx); + struct si_state_rasterizer *rs = sctx->queued.named.rasterizer; unsigned window_space = info->properties[TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION]; unsigned clipdist_mask = info->writes_clipvertex ? SIX_BITS : info->clipdist_writemask; + unsigned ucp_mask = clipdist_mask ? 0 : rs->clip_plane_enable & SIX_BITS; unsigned total_mask = clipdist_mask | (info->culldist_writemask << info->num_written_clipdistance); radeon_set_context_reg(cs, R_02881C_PA_CL_VS_OUT_CNTL, @@ -663,12 +665,11 @@ static void si_emit_clip_regs(struct si_context *sctx, struct r600_atom *atom) info->writes_layer || info->writes_viewport_index) | S_02881C_VS_OUT_MISC_SIDE_BUS_ENA(1) | - (sctx->queued.named.rasterizer->clip_plane_enable & + (rs->clip_plane_enable & clipdist_mask) | (info->culldist_writemask << 8)); radeon_set_context_reg(cs, R_028810_PA_CL_CLIP_CNTL, - sctx->queued.named.rasterizer->pa_cl_clip_cntl | - (clipdist_mask ? 0 : - sctx->queued.named.rasterizer->clip_plane_enable & SIX_BITS) | + rs->pa_cl_clip_cntl | + ucp_mask | S_028810_CLIP_DISABLE(window_space)); /* reuse needs to be set off if we write oViewport */ |