mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
panfrost: Only cull polygons
The spec says only polygons, not points/lines, should be culled when
culling is enabled. The hardware does not make this distinction, so we
have to.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Icecream95 <ixn@disroot.org>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>
(cherry picked from commit 1e5bb54f59)
This commit is contained in:
parent
b5ff627603
commit
fbd47b9d43
3 changed files with 13 additions and 4 deletions
|
|
@ -688,7 +688,7 @@
|
|||
"description": "panfrost: Only cull polygons",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2716,6 +2716,7 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
|
|||
}
|
||||
|
||||
enum pipe_prim_type prim = u_reduced_prim(info->mode);
|
||||
bool polygon = (prim == PIPE_PRIM_TRIANGLES);
|
||||
void *prim_size = pan_section_ptr(job, TILER_JOB, PRIMITIVE_SIZE);
|
||||
|
||||
#if PAN_ARCH >= 6
|
||||
|
|
@ -2731,8 +2732,17 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
|
|||
cfg.four_components_per_vertex = true;
|
||||
cfg.draw_descriptor_is_64b = true;
|
||||
cfg.front_face_ccw = rast->front_ccw;
|
||||
cfg.cull_front_face = rast->cull_face & PIPE_FACE_FRONT;
|
||||
cfg.cull_back_face = rast->cull_face & PIPE_FACE_BACK;
|
||||
|
||||
/*
|
||||
* From the Gallium documentation,
|
||||
* pipe_rasterizer_state::cull_face "indicates which faces of
|
||||
* polygons to cull". Points and lines are not considered
|
||||
* polygons and should be drawn even if all faces are culled.
|
||||
* The hardware does not take primitive type into account when
|
||||
* culling, so we need to do that check ourselves.
|
||||
*/
|
||||
cfg.cull_front_face = polygon && (rast->cull_face & PIPE_FACE_FRONT);
|
||||
cfg.cull_back_face = polygon && (rast->cull_face & PIPE_FACE_BACK);
|
||||
cfg.position = pos;
|
||||
cfg.state = batch->rsd[PIPE_SHADER_FRAGMENT];
|
||||
cfg.attributes = batch->attribs[PIPE_SHADER_FRAGMENT];
|
||||
|
|
|
|||
|
|
@ -1154,7 +1154,6 @@ spec@!opengl 1.1@linestipple,Fail
|
|||
spec@!opengl 1.1@linestipple@Line loop,Fail
|
||||
spec@!opengl 1.1@linestipple@Line strip,Fail
|
||||
spec@!opengl 1.1@linestipple@Restarting lines within a single Begin-End block,Fail
|
||||
spec@!opengl 1.1@point-line-no-cull,Fail
|
||||
spec@!opengl 1.1@polygon-mode-facing,Fail
|
||||
spec@!opengl 1.1@polygon-mode,Fail
|
||||
spec@!opengl 1.1@polygon-mode-offset@config 0: Expected white pixel on bottom edge,Fail
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue