nir: add nir_io_separate_clip_cull_distance_arrays to replace PIPE_CAP
to make the flag available in NIR passes Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32173>
This commit is contained in:
@@ -375,9 +375,6 @@ The integer capabilities:
|
||||
* ``PIPE_CAP_CULL_DISTANCE``: Whether the driver supports the
|
||||
:ext:`GL_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_SHADER_GROUP_VOTE``: Whether the ``VOTE_*`` ops can be used in
|
||||
|
||||
@@ -1470,7 +1470,8 @@ prelink_lowering(const struct gl_constants *consts,
|
||||
* - shader_info::clip_distance_array_size
|
||||
* - shader_info::cull_distance_array_size
|
||||
*/
|
||||
if (consts->CombinedClipCullDistanceArrays)
|
||||
if (!(nir->options->io_options &
|
||||
nir_io_separate_clip_cull_distance_arrays))
|
||||
NIR_PASS(_, nir, nir_lower_clip_cull_distance_arrays);
|
||||
}
|
||||
|
||||
|
||||
@@ -3865,6 +3865,15 @@ typedef enum {
|
||||
* Use MESA_GLSL_DISABLE_IO_OPT=1 instead.
|
||||
*/
|
||||
nir_io_dont_optimize = BITFIELD_BIT(17),
|
||||
|
||||
/**
|
||||
* Whether clip and cull distance arrays should be separate. If this is not
|
||||
* set, cull distances will be moved into VARYING_SLOT_CLIP_DISTn after clip
|
||||
* distances, and shader_info::clip_distance_array_size will be the index
|
||||
* of the first cull distance. nir_lower_clip_cull_distance_arrays does
|
||||
* that.
|
||||
*/
|
||||
nir_io_separate_clip_cull_distance_arrays = BITFIELD_BIT(18),
|
||||
} nir_io_options;
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -304,7 +304,6 @@ 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_SHADER_GROUP_VOTE:
|
||||
case PIPE_CAP_MAX_WINDOW_RECTANGLES: /* Enables EXT_window_rectangles */
|
||||
case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
|
||||
|
||||
@@ -1338,7 +1338,7 @@ zink_screen_init_compiler(struct zink_screen *screen)
|
||||
{
|
||||
static const struct nir_shader_compiler_options
|
||||
default_options = {
|
||||
.io_options = nir_io_has_intrinsics,
|
||||
.io_options = nir_io_has_intrinsics | nir_io_separate_clip_cull_distance_arrays,
|
||||
.lower_ffma16 = true,
|
||||
.lower_ffma32 = true,
|
||||
.lower_ffma64 = true,
|
||||
|
||||
@@ -639,7 +639,6 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0:
|
||||
case PIPE_CAP_PACKED_UNIFORMS:
|
||||
case PIPE_CAP_SHADER_PACK_HALF_FLOAT:
|
||||
case PIPE_CAP_CULL_DISTANCE_NOCOMBINE:
|
||||
case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
|
||||
case PIPE_CAP_LOAD_CONSTBUF:
|
||||
case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
|
||||
|
||||
@@ -837,7 +837,6 @@ 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_SHADER_GROUP_VOTE,
|
||||
PIPE_CAP_MAX_WINDOW_RECTANGLES,
|
||||
PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED,
|
||||
|
||||
@@ -950,8 +950,6 @@ struct gl_constants
|
||||
|
||||
bool HasFBFetch;
|
||||
|
||||
bool CombinedClipCullDistanceArrays;
|
||||
|
||||
bool PointSizeFixed;
|
||||
|
||||
/** Wether or not glBitmap uses red textures rather than alpha */
|
||||
|
||||
@@ -199,8 +199,6 @@ void st_init_limits(struct pipe_screen *screen,
|
||||
|
||||
c->HasFBFetch = screen->get_param(screen, PIPE_CAP_FBFETCH);
|
||||
|
||||
c->CombinedClipCullDistanceArrays = !screen->get_param(screen, PIPE_CAP_CULL_DISTANCE_NOCOMBINE);
|
||||
|
||||
c->PointSizeFixed = screen->get_param(screen, PIPE_CAP_POINT_SIZE_FIXED) != PIPE_POINT_SIZE_LOWER_ALWAYS;
|
||||
|
||||
for (sh = 0; sh < PIPE_SHADER_TYPES; ++sh) {
|
||||
|
||||
Reference in New Issue
Block a user