gallium: replace PIPE_SHADER_CAP_INDIRECT_INPUT/OUTPUT_ADDR with NIR options

This is a prerequisite for enabling nir_opt_varyings for all gallium
drivers.

nir_lower_io_passes (called by the GLSL linker) only uses NIR options
to lower indirect IO access before lowering IO and calling
nir_opt_varyings.

Most drivers report full support for indirect IO and lower it themselves,
which prevents compaction of lowered indirectly accessed varyings because
nir_opt_varyings doesn't touch indirect varyings.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> (Rb for asahi)
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com> (for r300)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32423>
This commit is contained in:
Marek Olšák
2024-11-29 17:43:34 -05:00
committed by Marge Bot
parent f930201898
commit 7f4e36ff7d
42 changed files with 87 additions and 118 deletions
+2
View File
@@ -79,6 +79,8 @@ const struct nir_shader_compiler_options brw_scalar_nir_options = {
.vectorize_tess_levels = true,
.vertex_id_zero_based = true,
.scalarize_ddx = true,
.support_indirect_inputs = (uint8_t)BITFIELD_MASK(PIPE_SHADER_TYPES),
.support_indirect_outputs = (uint8_t)BITFIELD_MASK(PIPE_SHADER_TYPES),
};
struct brw_compiler *
+2
View File
@@ -122,6 +122,8 @@ elk_compiler_create(void *mem_ctx, const struct intel_device_info *devinfo)
nir_options->lower_doubles_options = fp64_options;
nir_options->unify_interfaces = i < MESA_SHADER_FRAGMENT;
nir_options->support_indirect_inputs = (uint8_t)BITFIELD_MASK(PIPE_SHADER_TYPES),
nir_options->support_indirect_outputs = (uint8_t)BITFIELD_MASK(PIPE_SHADER_TYPES),
nir_options->force_indirect_unrolling |=
elk_nir_no_indirect_mask(compiler, i);
+3 -1
View File
@@ -31,7 +31,9 @@
.vertex_id_zero_based = true, \
.lower_base_vertex = true, \
.support_16bit_alu = true, \
.lower_uniforms_to_ubo = true
.lower_uniforms_to_ubo = true, \
.support_indirect_inputs = (uint8_t)BITFIELD_MASK(PIPE_SHADER_TYPES), \
.support_indirect_outputs = (uint8_t)BITFIELD_MASK(PIPE_SHADER_TYPES)
#define COMMON_SCALAR_OPTIONS \
.lower_to_scalar = true, \