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:
@@ -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 *
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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, \
|
||||
|
||||
Reference in New Issue
Block a user