nir: replace lower_io_variables with a GLSL NIR flag
This stops using it in nir_lower_io_passes because all callers call it only when it's true. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26918>
This commit is contained in:
@@ -3564,6 +3564,14 @@ typedef enum {
|
|||||||
* location, and then also as centroid, at_offset, and at_sample.
|
* location, and then also as centroid, at_offset, and at_sample.
|
||||||
*/
|
*/
|
||||||
nir_io_has_flexible_input_interpolation_except_flat = BITFIELD_BIT(0),
|
nir_io_has_flexible_input_interpolation_except_flat = BITFIELD_BIT(0),
|
||||||
|
|
||||||
|
/* Options affecting the GLSL compiler are below. */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lower load_deref/store_deref to load_input/store_output/etc. intrinsics.
|
||||||
|
* This is only affects GLSL compilation.
|
||||||
|
*/
|
||||||
|
nir_io_glsl_lower_derefs = BITFIELD_BIT(16),
|
||||||
} nir_io_options;
|
} nir_io_options;
|
||||||
|
|
||||||
/** An instruction filtering callback
|
/** An instruction filtering callback
|
||||||
@@ -4012,16 +4020,10 @@ typedef struct nir_shader_compiler_options {
|
|||||||
nir_lower_doubles_options lower_doubles_options;
|
nir_lower_doubles_options lower_doubles_options;
|
||||||
nir_divergence_options divergence_analysis_options;
|
nir_divergence_options divergence_analysis_options;
|
||||||
|
|
||||||
/**
|
|
||||||
* Lower load_deref/store_deref of inputs and outputs into
|
|
||||||
* load_input/store_input intrinsics. This is used by nir_lower_io_passes.
|
|
||||||
*/
|
|
||||||
bool lower_io_variables;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The masks of shader stages that support indirect indexing with
|
* The masks of shader stages that support indirect indexing with
|
||||||
* load_input and store_output intrinsics. It's used when
|
* load_input and store_output intrinsics. It's used by
|
||||||
* lower_io_variables is true. This is used by nir_lower_io_passes.
|
* nir_lower_io_passes.
|
||||||
*/
|
*/
|
||||||
uint8_t support_indirect_inputs;
|
uint8_t support_indirect_inputs;
|
||||||
uint8_t support_indirect_outputs;
|
uint8_t support_indirect_outputs;
|
||||||
|
@@ -3190,8 +3190,7 @@ type_size_vec4(const struct glsl_type *type, bool bindless)
|
|||||||
void
|
void
|
||||||
nir_lower_io_passes(nir_shader *nir, bool renumber_vs_inputs)
|
nir_lower_io_passes(nir_shader *nir, bool renumber_vs_inputs)
|
||||||
{
|
{
|
||||||
if (!nir->options->lower_io_variables ||
|
if (nir->info.stage == MESA_SHADER_COMPUTE)
|
||||||
nir->info.stage == MESA_SHADER_COMPUTE)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool has_indirect_inputs =
|
bool has_indirect_inputs =
|
||||||
|
@@ -1420,8 +1420,8 @@ void si_init_screen_get_functions(struct si_screen *sscreen)
|
|||||||
* when execution mode is rtz instead of rtne.
|
* when execution mode is rtz instead of rtne.
|
||||||
*/
|
*/
|
||||||
options->force_f2f16_rtz = true;
|
options->force_f2f16_rtz = true;
|
||||||
options->io_options = nir_io_has_flexible_input_interpolation_except_flat;
|
options->io_options = nir_io_has_flexible_input_interpolation_except_flat |
|
||||||
options->lower_io_variables = true;
|
nir_io_glsl_lower_derefs;
|
||||||
/* HW supports indirect indexing for: | Enabled in driver
|
/* HW supports indirect indexing for: | Enabled in driver
|
||||||
* -------------------------------------------------------
|
* -------------------------------------------------------
|
||||||
* TCS inputs | Yes
|
* TCS inputs | Yes
|
||||||
|
@@ -864,7 +864,7 @@ st_finalize_nir(struct st_context *st, struct gl_program *prog,
|
|||||||
/* Lower load_deref/store_deref of inputs and outputs.
|
/* Lower load_deref/store_deref of inputs and outputs.
|
||||||
* This depends on st_nir_assign_varying_locations.
|
* This depends on st_nir_assign_varying_locations.
|
||||||
*/
|
*/
|
||||||
if (nir->options->lower_io_variables) {
|
if (nir->options->io_options & nir_io_glsl_lower_derefs) {
|
||||||
nir_lower_io_passes(nir, false);
|
nir_lower_io_passes(nir, false);
|
||||||
NIR_PASS(_, nir, nir_remove_dead_variables,
|
NIR_PASS(_, nir, nir_remove_dead_variables,
|
||||||
nir_var_shader_in | nir_var_shader_out, NULL);
|
nir_var_shader_in | nir_var_shader_out, NULL);
|
||||||
|
Reference in New Issue
Block a user