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
+11
View File
@@ -3676,6 +3676,17 @@ nvir_nir_shader_compiler_options(int chipset, uint8_t shader_type)
op.discard_is_demote = true;
op.has_ddx_intrinsics = true;
op.scalarize_ddx = true;
op.support_indirect_inputs = (uint8_t)BITFIELD_MASK(MESA_SHADER_GEOMETRY + 1);
op.support_indirect_outputs = (uint8_t)BITFIELD_MASK(MESA_SHADER_GEOMETRY + 1);
/* HW doesn't support indirect addressing of fragment program inputs
* on Volta. The binary driver generates a function to handle every
* possible indirection, and indirectly calls the function to handle
* this instead.
*/
if (chipset < NVISA_GV100_CHIPSET)
op.support_indirect_outputs |= BITFIELD_BIT(MESA_SHADER_FRAGMENT);
return op;
}