aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state_viewport.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-09-26 18:10:58 +0200
committerNicolai Hähnle <[email protected]>2017-10-02 15:07:45 +0200
commit63680471f9f3e7047a2b074e824e449e59e4c8e9 (patch)
tree56a5939f5a25b9f4231e63e3a7e503eb16252cab /src/gallium/drivers/radeonsi/si_state_viewport.c
parent12f3155e28f335911d10aadabda03ec4f9bcbf16 (diff)
radeonsi: remove si_context::{scissor_enabled,clip_halfz}
They are just copies of the rasterizer state. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state_viewport.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_state_viewport.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_viewport.c b/src/gallium/drivers/radeonsi/si_state_viewport.c
index 8e08a61f2f6..1201be8779e 100644
--- a/src/gallium/drivers/radeonsi/si_state_viewport.c
+++ b/src/gallium/drivers/radeonsi/si_state_viewport.c
@@ -40,7 +40,8 @@ static void si_set_scissor_states(struct pipe_context *pctx,
for (i = 0; i < num_scissors; i++)
ctx->scissors.states[start_slot + i] = state[i];
- if (!ctx->scissor_enabled)
+ if (!ctx->queued.named.rasterizer ||
+ !ctx->queued.named.rasterizer->scissor_enable)
return;
ctx->scissors.dirty_mask |= ((1 << num_scissors) - 1) << start_slot;
@@ -214,10 +215,13 @@ static void si_emit_scissors(struct r600_common_context *rctx, struct r600_atom
struct radeon_winsys_cs *cs = ctx->b.gfx.cs;
struct pipe_scissor_state *states = ctx->scissors.states;
unsigned mask = ctx->scissors.dirty_mask;
- bool scissor_enabled = ctx->scissor_enabled;
+ bool scissor_enabled = false;
struct si_signed_scissor max_vp_scissor;
int i;
+ if (ctx->queued.named.rasterizer)
+ scissor_enabled = ctx->queued.named.rasterizer->scissor_enable;
+
/* The simple case: Only 1 viewport is active. */
if (!ctx->vs_writes_viewport_index) {
struct si_signed_scissor *vp = &ctx->viewports.as_scissor[0];
@@ -327,14 +331,18 @@ static void si_emit_depth_ranges(struct si_context *ctx)
struct radeon_winsys_cs *cs = ctx->b.gfx.cs;
struct pipe_viewport_state *states = ctx->viewports.states;
unsigned mask = ctx->viewports.depth_range_dirty_mask;
+ bool clip_halfz = false;
float zmin, zmax;
+ if (ctx->queued.named.rasterizer)
+ clip_halfz = ctx->queued.named.rasterizer->clip_halfz;
+
/* The simple case: Only 1 viewport is active. */
if (!ctx->vs_writes_viewport_index) {
if (!(mask & 1))
return;
- util_viewport_zmin_zmax(&states[0], ctx->clip_halfz, &zmin, &zmax);
+ util_viewport_zmin_zmax(&states[0], clip_halfz, &zmin, &zmax);
radeon_set_context_reg_seq(cs, R_0282D0_PA_SC_VPORT_ZMIN_0, 2);
radeon_emit(cs, fui(zmin));
@@ -351,7 +359,7 @@ static void si_emit_depth_ranges(struct si_context *ctx)
radeon_set_context_reg_seq(cs, R_0282D0_PA_SC_VPORT_ZMIN_0 +
start * 4 * 2, count * 2);
for (i = start; i < start+count; i++) {
- util_viewport_zmin_zmax(&states[i], ctx->clip_halfz, &zmin, &zmax);
+ util_viewport_zmin_zmax(&states[i], clip_halfz, &zmin, &zmax);
radeon_emit(cs, fui(zmin));
radeon_emit(cs, fui(zmax));
}
@@ -367,22 +375,6 @@ static void si_emit_viewport_states(struct r600_common_context *rctx,
si_emit_depth_ranges(ctx);
}
-/* Set viewport dependencies on pipe_rasterizer_state. */
-void si_viewport_set_rast_deps(struct si_context *ctx,
- bool scissor_enable, bool clip_halfz)
-{
- if (ctx->scissor_enabled != scissor_enable) {
- ctx->scissor_enabled = scissor_enable;
- ctx->scissors.dirty_mask = (1 << SI_MAX_VIEWPORTS) - 1;
- si_mark_atom_dirty(ctx, &ctx->scissors.atom);
- }
- if (ctx->clip_halfz != clip_halfz) {
- ctx->clip_halfz = clip_halfz;
- ctx->viewports.depth_range_dirty_mask = (1 << SI_MAX_VIEWPORTS) - 1;
- si_mark_atom_dirty(ctx, &ctx->viewports.atom);
- }
-}
-
/**
* Normally, we only emit 1 viewport and 1 scissor if no shader is using
* the VIEWPORT_INDEX output, and emitting the other viewports and scissors