mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 12:30:09 +01:00
etnaviv: Support hw based rasterizer_discard
Add native hardware support for rasterizer_discard on GPU cores that support the HWTFB (Hardware Transform Feedback) feature. This moves rasterizer discard handling from software clipping to dedicated hardware state. Passes all dEQP-GLES3.functional.rasterizer_discard.* with HWTFB. Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37320>
This commit is contained in:
parent
53ff96a227
commit
ebd5504f73
4 changed files with 10 additions and 1 deletions
|
|
@ -606,6 +606,11 @@ etna_emit_state(struct etna_context *ctx)
|
|||
}
|
||||
}
|
||||
|
||||
if (unlikely(VIV_FEATURE(screen, ETNA_FEATURE_HWTFB) &&
|
||||
(dirty & ETNA_DIRTY_RASTERIZER))) {
|
||||
/*1C000*/ EMIT_STATE(TFB_CONFIG, etna_rasterizer_state(ctx->rasterizer)->TFB_CONFIG);
|
||||
}
|
||||
|
||||
etna_coalesce_end(stream, &coalesce);
|
||||
/* end only EMIT_STATE */
|
||||
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ etna_rasterizer_state_create(struct pipe_context *pctx,
|
|||
cs->offset_units = 0.0f;
|
||||
}
|
||||
|
||||
cs->TFB_CONFIG = COND(so->rasterizer_discard, VIVS_TFB_CONFIG_RASTERIZER_DISCARD);
|
||||
|
||||
assert(!so->clip_halfz); /* could be supported with shader magic, actually
|
||||
D3D z is default on older gc */
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ struct etna_rasterizer_state {
|
|||
uint32_t PA_POINT_SIZE;
|
||||
uint32_t PA_SYSTEM_MODE;
|
||||
uint32_t SE_DEPTH_SCALE;
|
||||
uint32_t TFB_CONFIG;
|
||||
float offset_units;
|
||||
uint32_t SE_CONFIG;
|
||||
bool point_size_per_vertex;
|
||||
|
|
|
|||
|
|
@ -812,7 +812,8 @@ etna_update_clipping(struct etna_context *ctx)
|
|||
const struct etna_rasterizer_state *rasterizer = etna_rasterizer_state(ctx->rasterizer);
|
||||
const struct pipe_framebuffer_state *fb = &ctx->framebuffer_s;
|
||||
|
||||
if (ctx->rasterizer->rasterizer_discard) {
|
||||
if (!VIV_FEATURE(ctx->screen, ETNA_FEATURE_HWTFB) &&
|
||||
ctx->rasterizer->rasterizer_discard) {
|
||||
ctx->clipping.minx = 0;
|
||||
ctx->clipping.miny = 0;
|
||||
ctx->clipping.maxx = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue