gallium: add PIPE_CAP_CULL_DISTANCE_NOCOMBINE

for drivers where separate cull distance variables are required, this
lets them avoid having to write yet another pass to undo gallium's mangling
of shader info

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14878>
This commit is contained in:
Mike Blumenkrantz 2022-02-04 11:15:08 -05:00 committed by Marge Bot
parent 93a90fc85d
commit 7e9481eaac
4 changed files with 7 additions and 1 deletions

View file

@ -374,6 +374,9 @@ The integer capabilities:
and accesses to unbound resources.
* ``PIPE_CAP_CULL_DISTANCE``: Whether the driver supports the arb_cull_distance
extension and thus implements proper support for culling planes.
* ``PIPE_CAP_CULL_DISTANCE_NOCOMBINE``: Whether the driver wants to skip
running the `nir_lower_clip_cull_distance_arrays` pass in order to get
VARYING_SLOT_CULL_DIST0 slot variables.
* ``PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES``: Whether primitive restart is
supported for patch primitives.
* ``PIPE_CAP_TGSI_VOTE``: Whether the ``VOTE_*`` ops can be used in shaders.

View file

@ -275,6 +275,7 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
case PIPE_CAP_CULL_DISTANCE:
case PIPE_CAP_CULL_DISTANCE_NOCOMBINE:
case PIPE_CAP_TGSI_VOTE:
case PIPE_CAP_MAX_WINDOW_RECTANGLES: /* Enables EXT_window_rectangles */
case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:

View file

@ -875,6 +875,7 @@ enum pipe_cap
PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT,
PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR,
PIPE_CAP_CULL_DISTANCE,
PIPE_CAP_CULL_DISTANCE_NOCOMBINE,
PIPE_CAP_TGSI_VOTE,
PIPE_CAP_MAX_WINDOW_RECTANGLES,
PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED,

View file

@ -768,6 +768,7 @@ st_link_nir(struct gl_context *ctx,
NIR_PASS_V(nir, nir_lower_system_values);
NIR_PASS_V(nir, nir_lower_compute_system_values, NULL);
if (!st->screen->get_param(st->screen, PIPE_CAP_CULL_DISTANCE_NOCOMBINE))
NIR_PASS_V(nir, nir_lower_clip_cull_distance_arrays);
st_shader_gather_info(nir, shader->Program);