Skip to content

Draft: nir,glsl,st/mesa: prerequisites for enabling nir_opt_varyings for all gallium drivers and removing IO variable codepaths from st/mesa

Marek Olšák requested to merge mareko/mesa:st-always-lower-io-prereq into main

Non-trivial changes:

  • Changes in nir_opt_varyings to support drivers that can't mix different interpolation qualifiers in the same vec4.
  • New pass st_nir_unlower_io_to_vars that will be used to convert IO intrinsics back to variables.

Also: New helper nir_clear_divergence_info to work around the assertion failure in nir_convert_from_ssa - copy_values and other minor NIR changes.

The idea is that the GLSL linker will always lower variables to IO intrinsics, run nir_opt_varyings and nir_opt_vectorize_io (which produce better code), then st/mesa and all its passes will only operate on IO intrinsics, and right before we pass shaders to drivers, we unlower IO back to variables for drivers that don't support IO intrinsics.

These are all the prerequisites, including the new pass st_nir_unlower_io_to_vars, which already works well with softpipe and llvmpipe. The next MR will make the switch.

Merge request reports

Loading