mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 20:30:12 +01:00
panfrost: Remove scissor_culls_everything
Based on a misunderstanding of how the scissor test works, and in particular breaks transform feedback and SSBO writes from vertex shaders. Replace it with a moral equivalent to rasterizer_discard so vertex shaders still run. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>
This commit is contained in:
parent
0186367dc7
commit
8d687cb65e
3 changed files with 6 additions and 21 deletions
|
|
@ -767,6 +767,8 @@ panfrost_emit_viewport(struct panfrost_batch *batch)
|
|||
}
|
||||
|
||||
panfrost_batch_union_scissor(batch, minx, miny, maxx, maxy);
|
||||
batch->scissor_culls_everything = (minx >= maxx || miny >= maxy);
|
||||
|
||||
return T.gpu;
|
||||
}
|
||||
|
||||
|
|
@ -2356,7 +2358,7 @@ panfrost_emit_vertex_tiler_jobs(struct panfrost_batch *batch,
|
|||
batch->indirect_draw_job_id : 0,
|
||||
0, vertex_job, false);
|
||||
|
||||
if (ctx->rasterizer->base.rasterizer_discard)
|
||||
if (ctx->rasterizer->base.rasterizer_discard || batch->scissor_culls_everything)
|
||||
return;
|
||||
|
||||
panfrost_add_job(&batch->pool, &batch->scoreboard,
|
||||
|
|
|
|||
|
|
@ -154,19 +154,6 @@ pan_draw_mode(enum pipe_prim_type mode)
|
|||
|
||||
#undef DEFINE_CASE
|
||||
|
||||
static bool
|
||||
panfrost_scissor_culls_everything(struct panfrost_context *ctx)
|
||||
{
|
||||
const struct pipe_scissor_state *ss = &ctx->scissor;
|
||||
|
||||
/* Check if we're scissoring at all */
|
||||
|
||||
if (!ctx->rasterizer->base.scissor)
|
||||
return false;
|
||||
|
||||
return (ss->minx == ss->maxx) || (ss->miny == ss->maxy);
|
||||
}
|
||||
|
||||
/* Count generated primitives (when there is no geom/tess shaders) for
|
||||
* transform feedback */
|
||||
|
||||
|
|
@ -740,13 +727,6 @@ panfrost_draw_vbo(struct pipe_context *pipe,
|
|||
struct panfrost_context *ctx = pan_context(pipe);
|
||||
struct panfrost_device *dev = pan_device(pipe->screen);
|
||||
|
||||
/* First of all, check the scissor to see if anything is drawn at all.
|
||||
* If it's not, we drop the draw (mostly a conformance issue;
|
||||
* well-behaved apps shouldn't hit this) */
|
||||
|
||||
if (panfrost_scissor_culls_everything(ctx))
|
||||
return;
|
||||
|
||||
if (!panfrost_render_condition_check(ctx))
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -76,6 +76,9 @@ struct panfrost_batch {
|
|||
unsigned minx, miny;
|
||||
unsigned maxx, maxy;
|
||||
|
||||
/* Acts as a rasterizer discard */
|
||||
bool scissor_culls_everything;
|
||||
|
||||
/* BOs referenced not in the pool */
|
||||
struct hash_table *bos;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue