mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
etnaviv: get rid of SE_CLIP_*
The only difference between e.g. SE_SCISSOR_RIGHT and SE_CLIP_RIGHT is the used margin value. With that information we can remove SE_CLIP_* and apply the different margins during emit time. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Jonathan Marek <jonathan@marek.ca> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4278>
This commit is contained in:
parent
27d58a1c20
commit
95763e20ce
3 changed files with 14 additions and 28 deletions
|
|
@ -416,8 +416,8 @@ etna_emit_state(struct etna_context *ctx)
|
|||
|
||||
/*00C00*/ EMIT_STATE_FIXP(SE_SCISSOR_LEFT, scissor_left);
|
||||
/*00C04*/ EMIT_STATE_FIXP(SE_SCISSOR_TOP, scissor_top);
|
||||
/*00C08*/ EMIT_STATE_FIXP(SE_SCISSOR_RIGHT, scissor_right);
|
||||
/*00C0C*/ EMIT_STATE_FIXP(SE_SCISSOR_BOTTOM, scissor_bottom);
|
||||
/*00C08*/ EMIT_STATE_FIXP(SE_SCISSOR_RIGHT, scissor_right + ETNA_SE_SCISSOR_MARGIN_RIGHT);
|
||||
/*00C0C*/ EMIT_STATE_FIXP(SE_SCISSOR_BOTTOM, scissor_bottom + ETNA_SE_SCISSOR_MARGIN_BOTTOM);
|
||||
}
|
||||
if (unlikely(dirty & (ETNA_DIRTY_RASTERIZER))) {
|
||||
struct etna_rasterizer_state *rasterizer = etna_rasterizer_state(ctx->rasterizer);
|
||||
|
|
@ -431,17 +431,17 @@ etna_emit_state(struct etna_context *ctx)
|
|||
struct etna_rasterizer_state *rasterizer = etna_rasterizer_state(ctx->rasterizer);
|
||||
|
||||
uint32_t clip_right =
|
||||
MIN2(ctx->framebuffer.SE_CLIP_RIGHT, ctx->viewport.SE_CLIP_RIGHT);
|
||||
MIN2(ctx->framebuffer.SE_SCISSOR_RIGHT, ctx->viewport.SE_SCISSOR_RIGHT);
|
||||
uint32_t clip_bottom =
|
||||
MIN2(ctx->framebuffer.SE_CLIP_BOTTOM, ctx->viewport.SE_CLIP_BOTTOM);
|
||||
MIN2(ctx->framebuffer.SE_SCISSOR_BOTTOM, ctx->viewport.SE_SCISSOR_BOTTOM);
|
||||
|
||||
if (rasterizer->scissor) {
|
||||
clip_right = MIN2(ctx->scissor.SE_CLIP_RIGHT, clip_right);
|
||||
clip_bottom = MIN2(ctx->scissor.SE_CLIP_BOTTOM, clip_bottom);
|
||||
clip_right = MIN2(ctx->scissor.SE_SCISSOR_RIGHT, clip_right);
|
||||
clip_bottom = MIN2(ctx->scissor.SE_SCISSOR_BOTTOM, clip_bottom);
|
||||
}
|
||||
|
||||
/*00C20*/ EMIT_STATE_FIXP(SE_CLIP_RIGHT, clip_right);
|
||||
/*00C24*/ EMIT_STATE_FIXP(SE_CLIP_BOTTOM, clip_bottom);
|
||||
/*00C20*/ EMIT_STATE_FIXP(SE_CLIP_RIGHT, clip_right + ETNA_SE_CLIP_MARGIN_RIGHT);
|
||||
/*00C24*/ EMIT_STATE_FIXP(SE_CLIP_BOTTOM, clip_bottom + ETNA_SE_CLIP_MARGIN_BOTTOM);
|
||||
}
|
||||
if (unlikely(dirty & (ETNA_DIRTY_SHADER))) {
|
||||
/*00E00*/ EMIT_STATE(RA_CONTROL, ctx->shader_state.RA_CONTROL);
|
||||
|
|
|
|||
|
|
@ -163,8 +163,6 @@ struct compiled_scissor_state {
|
|||
uint32_t SE_SCISSOR_TOP;
|
||||
uint32_t SE_SCISSOR_RIGHT;
|
||||
uint32_t SE_SCISSOR_BOTTOM;
|
||||
uint32_t SE_CLIP_RIGHT;
|
||||
uint32_t SE_CLIP_BOTTOM;
|
||||
};
|
||||
|
||||
/* Compiled pipe_viewport_state */
|
||||
|
|
@ -179,8 +177,6 @@ struct compiled_viewport_state {
|
|||
uint32_t SE_SCISSOR_TOP;
|
||||
uint32_t SE_SCISSOR_RIGHT;
|
||||
uint32_t SE_SCISSOR_BOTTOM;
|
||||
uint32_t SE_CLIP_RIGHT;
|
||||
uint32_t SE_CLIP_BOTTOM;
|
||||
uint32_t PE_DEPTH_NEAR;
|
||||
uint32_t PE_DEPTH_FAR;
|
||||
};
|
||||
|
|
@ -203,8 +199,6 @@ struct compiled_framebuffer_state {
|
|||
uint32_t SE_SCISSOR_TOP;
|
||||
uint32_t SE_SCISSOR_RIGHT;
|
||||
uint32_t SE_SCISSOR_BOTTOM;
|
||||
uint32_t SE_CLIP_RIGHT;
|
||||
uint32_t SE_CLIP_BOTTOM;
|
||||
uint32_t RA_MULTISAMPLE_UNK00E04;
|
||||
uint32_t RA_MULTISAMPLE_UNK00E10[VIVS_RA_MULTISAMPLE_UNK00E10__LEN];
|
||||
uint32_t RA_CENTROID_TABLE[VIVS_RA_CENTROID_TABLE__LEN];
|
||||
|
|
|
|||
|
|
@ -351,10 +351,8 @@ etna_set_framebuffer_state(struct pipe_context *pctx,
|
|||
/* Scissor setup */
|
||||
cs->SE_SCISSOR_LEFT = 0; /* affected by rasterizer and scissor state as well */
|
||||
cs->SE_SCISSOR_TOP = 0;
|
||||
cs->SE_SCISSOR_RIGHT = (fb->width << 16) + ETNA_SE_SCISSOR_MARGIN_RIGHT;
|
||||
cs->SE_SCISSOR_BOTTOM = (fb->height << 16) + ETNA_SE_SCISSOR_MARGIN_BOTTOM;
|
||||
cs->SE_CLIP_RIGHT = (fb->width << 16) + ETNA_SE_CLIP_MARGIN_RIGHT;
|
||||
cs->SE_CLIP_BOTTOM = (fb->height << 16) + ETNA_SE_CLIP_MARGIN_BOTTOM;
|
||||
cs->SE_SCISSOR_RIGHT = (fb->width << 16);
|
||||
cs->SE_SCISSOR_BOTTOM = (fb->height << 16);
|
||||
|
||||
cs->TS_MEM_CONFIG = ts_mem_config;
|
||||
cs->PE_MEM_CONFIG = pe_mem_config;
|
||||
|
|
@ -392,10 +390,8 @@ etna_set_scissor_states(struct pipe_context *pctx, unsigned start_slot,
|
|||
ctx->scissor_s = *ss;
|
||||
cs->SE_SCISSOR_LEFT = (ss->minx << 16);
|
||||
cs->SE_SCISSOR_TOP = (ss->miny << 16);
|
||||
cs->SE_SCISSOR_RIGHT = (ss->maxx << 16) + ETNA_SE_SCISSOR_MARGIN_RIGHT;
|
||||
cs->SE_SCISSOR_BOTTOM = (ss->maxy << 16) + ETNA_SE_SCISSOR_MARGIN_BOTTOM;
|
||||
cs->SE_CLIP_RIGHT = (ss->maxx << 16) + ETNA_SE_CLIP_MARGIN_RIGHT;
|
||||
cs->SE_CLIP_BOTTOM = (ss->maxy << 16) + ETNA_SE_CLIP_MARGIN_BOTTOM;
|
||||
cs->SE_SCISSOR_RIGHT = (ss->maxx << 16);
|
||||
cs->SE_SCISSOR_BOTTOM = (ss->maxy << 16);
|
||||
|
||||
ctx->dirty |= ETNA_DIRTY_SCISSOR;
|
||||
}
|
||||
|
|
@ -433,12 +429,8 @@ etna_set_viewport_states(struct pipe_context *pctx, unsigned start_slot,
|
|||
*/
|
||||
cs->SE_SCISSOR_LEFT = etna_f32_to_fixp16(MAX2(vs->translate[0] - fabsf(vs->scale[0]), 0.0f));
|
||||
cs->SE_SCISSOR_TOP = etna_f32_to_fixp16(MAX2(vs->translate[1] - fabsf(vs->scale[1]), 0.0f));
|
||||
uint32_t right_fixp = etna_f32_to_fixp16(MAX2(vs->translate[0] + fabsf(vs->scale[0]), 0.0f));
|
||||
uint32_t bottom_fixp = etna_f32_to_fixp16(MAX2(vs->translate[1] + fabsf(vs->scale[1]), 0.0f));
|
||||
cs->SE_SCISSOR_RIGHT = right_fixp + ETNA_SE_SCISSOR_MARGIN_RIGHT;
|
||||
cs->SE_SCISSOR_BOTTOM = bottom_fixp + ETNA_SE_SCISSOR_MARGIN_BOTTOM;
|
||||
cs->SE_CLIP_RIGHT = right_fixp + ETNA_SE_CLIP_MARGIN_RIGHT;
|
||||
cs->SE_CLIP_BOTTOM = bottom_fixp + ETNA_SE_CLIP_MARGIN_BOTTOM;
|
||||
cs->SE_SCISSOR_RIGHT = etna_f32_to_fixp16(MAX2(vs->translate[0] + fabsf(vs->scale[0]), 0.0f));
|
||||
cs->SE_SCISSOR_BOTTOM = etna_f32_to_fixp16(MAX2(vs->translate[1] + fabsf(vs->scale[1]), 0.0f));
|
||||
|
||||
cs->PE_DEPTH_NEAR = fui(0.0); /* not affected if depth mode is Z (as in GL) */
|
||||
cs->PE_DEPTH_FAR = fui(1.0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue