r600: Update nir options

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17076>
This commit is contained in:
Gert Wollny
2022-05-18 22:35:48 +02:00
committed by Marge Bot
parent 3525d29a8d
commit ab06b00c63
2 changed files with 31 additions and 24 deletions

View File

@@ -1186,7 +1186,10 @@ r600_get_compiler_options(struct pipe_screen *screen,
struct r600_common_screen *rscreen = (struct r600_common_screen *)screen;
if (shader != PIPE_SHADER_FRAGMENT)
return &rscreen->nir_options;
else
return &rscreen->nir_options_fs;
}
extern bool r600_lower_to_scalar_instr_filter(const nir_instr *instr, const void *);
@@ -1358,14 +1361,11 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
.lower_to_scalar = true,
.lower_to_scalar_filter = r600_lower_to_scalar_instr_filter,
.linker_ignore_precision = true,
.lower_fpow = true
};
rscreen->nir_options = nir_options;
/* The TGSI code path handles OPCODE_POW, but has problems with the
* lowered version, the NIT code path does the rightthing with the
* lowered code */
rscreen->nir_options.lower_fpow = rscreen->debug_flags & DBG_NIR_PREFERRED;
if (rscreen->info.family < CHIP_CEDAR)
rscreen->nir_options.force_indirect_unrolling_sampler = true;
@@ -1380,6 +1380,7 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
rscreen->nir_options.lower_doubles_options = nir_lower_fp64_full_software;
rscreen->nir_options.lower_int64_options = ~0;
} else {
fprintf(stderr, "Don't lower all fp64\n");
rscreen->nir_options.lower_doubles_options =
nir_lower_ddiv |
nir_lower_dfloor |
@@ -1391,6 +1392,8 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
}
if (!(rscreen->debug_flags & DBG_NIR_PREFERRED)) {
rscreen->nir_options.lower_fpow = false;
/* TGSI is vector, and NIR-to-TGSI doesn't like it when the
* input vars have been scalarized.
*/
@@ -1412,6 +1415,9 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
rscreen->nir_options.lower_find_msb_to_reverse = false;
}
rscreen->nir_options_fs = rscreen->nir_options;
rscreen->nir_options_fs.lower_all_io_to_temps = true;
return true;
}

View File

@@ -402,6 +402,7 @@ struct r600_common_screen {
} barrier_flags;
struct nir_shader_compiler_options nir_options;
struct nir_shader_compiler_options nir_options_fs;
};
/* This encapsulates a state or an operation which can emitted into the GPU