r600/sfn: lower to scalar with filter applied

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9943>
This commit is contained in:
Gert Wollny
2021-03-31 10:55:57 +02:00
committed by Marge Bot
parent e36d5c5f6e
commit c80877b535
3 changed files with 6 additions and 2 deletions

View File

@@ -1181,6 +1181,8 @@ r600_get_compiler_options(struct pipe_screen *screen,
return &rscreen->nir_options;
}
extern bool r600_lower_to_scalar_instr_filter(const nir_instr *instr, const void *);
bool r600_common_screen_init(struct r600_common_screen *rscreen,
struct radeon_winsys *ws)
{
@@ -1330,6 +1332,8 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
.lower_bitfield_insert_to_bitfield_select = true,
.has_fused_comp_and_csel = true,
.lower_find_msb_to_reverse = true,
.lower_to_scalar = true,
.lower_to_scalar_filter = r600_lower_to_scalar_instr_filter,
};
rscreen->nir_options = nir_options;

View File

@@ -810,6 +810,7 @@ bool has_saturate(const nir_function *func)
return false;
}
extern "C"
bool r600_lower_to_scalar_instr_filter(const nir_instr *instr, const void *)
{
if (instr->type != nir_instr_type_alu)
@@ -875,8 +876,6 @@ int r600_shader_from_nir(struct r600_context *rctx,
NIR_PASS_V(sel->nir, nir_lower_int64);
while(optimize_once(sel->nir, false));
NIR_PASS_V(sel->nir, nir_lower_alu_to_scalar, r600_lower_to_scalar_instr_filter, NULL);
NIR_PASS_V(sel->nir, r600_lower_shared_io);
NIR_PASS_V(sel->nir, r600_nir_lower_atomics);

View File

@@ -146,6 +146,7 @@ extern "C" {
bool r600_vectorize_vs_inputs(nir_shader *shader);
bool r600_lower_to_scalar_instr_filter(const nir_instr *instr, const void *);
int r600_shader_from_nir(struct r600_context *rctx,
struct r600_pipe_shader *pipeshader,