mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
nir: only print divergence information if metadata is valid
This disables printing of vertex divergence as well as outdated divergence information. Also remove info::divergence_analysis_run and use nir_metadata_divergence instead. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30814>
This commit is contained in:
parent
1d6082bf56
commit
63a656797b
3 changed files with 7 additions and 9 deletions
|
|
@ -1460,7 +1460,6 @@ nir_divergence_analysis(nir_shader *shader)
|
|||
nir_foreach_function_impl(impl, shader) {
|
||||
nir_metadata_require(impl, nir_metadata_divergence);
|
||||
}
|
||||
shader->info.divergence_analysis_run = true;
|
||||
}
|
||||
|
||||
/* Compute divergence between vertices of the same primitive. This uses
|
||||
|
|
@ -1470,8 +1469,6 @@ nir_divergence_analysis(nir_shader *shader)
|
|||
void
|
||||
nir_vertex_divergence_analysis(nir_shader *shader)
|
||||
{
|
||||
shader->info.divergence_analysis_run = false;
|
||||
|
||||
struct divergence_state state = {
|
||||
.stage = shader->info.stage,
|
||||
.shader = shader,
|
||||
|
|
|
|||
|
|
@ -80,6 +80,9 @@ typedef struct {
|
|||
*/
|
||||
unsigned padding_for_no_dest;
|
||||
|
||||
/* Whether divergence metadata is valid. */
|
||||
bool divergence_valid;
|
||||
|
||||
bool gather_debug_info;
|
||||
|
||||
nir_instr_debug_info last_debug_info;
|
||||
|
|
@ -112,7 +115,7 @@ static const char *sizes[] = { "x??", " ", "x2 ", "x3 ", "x4 ",
|
|||
static const char *
|
||||
divergence_status(print_state *state, bool divergent)
|
||||
{
|
||||
if (state->shader->info.divergence_analysis_run)
|
||||
if (state->divergence_valid)
|
||||
return divergent ? "div " : "con ";
|
||||
|
||||
return "";
|
||||
|
|
@ -148,7 +151,7 @@ print_def(nir_def *def, print_state *state)
|
|||
static unsigned
|
||||
calculate_padding_for_no_dest(print_state *state)
|
||||
{
|
||||
const unsigned div = state->shader->info.divergence_analysis_run ? 4 : 0;
|
||||
const unsigned div = state->divergence_valid ? 4 : 0;
|
||||
const unsigned ssa_size = 5;
|
||||
const unsigned percent = 1;
|
||||
const unsigned ssa_index = count_digits(state->max_dest_index);
|
||||
|
|
@ -2295,6 +2298,7 @@ print_function_impl(nir_function_impl *impl, print_state *state, bool print_name
|
|||
FILE *fp = state->fp;
|
||||
|
||||
state->max_dest_index = impl->ssa_alloc;
|
||||
state->divergence_valid = impl->valid_metadata & nir_metadata_divergence;
|
||||
|
||||
if (print_name) {
|
||||
fprintf(fp, "\nimpl %s ", impl->function->name);
|
||||
|
|
@ -2636,7 +2640,6 @@ print_shader_info(const struct shader_info *info, FILE *fp)
|
|||
|
||||
print_nz_bool(fp, "uses_texture_gather", info->uses_texture_gather);
|
||||
print_nz_bool(fp, "uses_resource_info_query", info->uses_resource_info_query);
|
||||
print_nz_bool(fp, "divergence_analysis_run", info->divergence_analysis_run);
|
||||
|
||||
print_nz_x8(fp, "bit_sizes_float", info->bit_sizes_float);
|
||||
print_nz_x8(fp, "bit_sizes_int", info->bit_sizes_int);
|
||||
|
|
@ -2863,6 +2866,7 @@ nir_print_instr(const nir_instr *instr, FILE *fp)
|
|||
if (instr->block) {
|
||||
nir_function_impl *impl = nir_cf_node_get_function(&instr->block->cf_node);
|
||||
state.shader = impl->function->shader;
|
||||
state.divergence_valid = impl->valid_metadata & nir_metadata_divergence;
|
||||
}
|
||||
|
||||
print_instr(instr, &state, 0);
|
||||
|
|
|
|||
|
|
@ -185,9 +185,6 @@ typedef struct shader_info {
|
|||
/* Whether texture size, levels, or samples is queried. */
|
||||
bool uses_resource_info_query:1;
|
||||
|
||||
/** Has divergence analysis ever been run? */
|
||||
bool divergence_analysis_run:1;
|
||||
|
||||
/* Bitmask of bit-sizes used with ALU instructions. */
|
||||
uint8_t bit_sizes_float;
|
||||
uint8_t bit_sizes_int;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue