st/mesa: Optionally call nir_vectorize_tess_levels()
This lets us vectorize gl_TessLevel{Inner,Outer} writes, using a pass developed for RADV. Not all backends are prepared to handle this, so we make it optional. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17944>
This commit is contained in:
@@ -3495,6 +3495,7 @@ typedef struct nir_shader_compiler_options {
|
||||
* for IO purposes and would prefer loads/stores be vectorized.
|
||||
*/
|
||||
bool vectorize_io;
|
||||
bool vectorize_tess_levels;
|
||||
bool lower_to_scalar;
|
||||
nir_instr_filter_cb lower_to_scalar_filter;
|
||||
|
||||
|
@@ -598,6 +598,11 @@ st_nir_vectorize_io(nir_shader *producer, nir_shader *consumer)
|
||||
return;
|
||||
|
||||
NIR_PASS_V(producer, nir_lower_io_to_vector, nir_var_shader_out);
|
||||
|
||||
if (producer->info.stage == MESA_SHADER_TESS_CTRL &&
|
||||
producer->options->vectorize_tess_levels)
|
||||
NIR_PASS_V(producer, nir_vectorize_tess_levels);
|
||||
|
||||
NIR_PASS_V(producer, nir_opt_combine_stores, nir_var_shader_out);
|
||||
|
||||
if ((producer)->info.stage != MESA_SHADER_TESS_CTRL) {
|
||||
|
Reference in New Issue
Block a user