mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 21:08:11 +02:00
ac/nir: add an option not to gather values in ac_nir_gather_prerast_store_output_info
This will be needed in the next commit. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35351>
This commit is contained in:
parent
ebdd97a993
commit
84e8e899cd
5 changed files with 17 additions and 14 deletions
|
|
@ -116,9 +116,8 @@ ac_nir_store_var_components(nir_builder *b, nir_variable *var, nir_def *value,
|
|||
unsigned component, unsigned writemask);
|
||||
|
||||
void
|
||||
ac_nir_gather_prerast_store_output_info(nir_builder *b,
|
||||
nir_intrinsic_instr *intrin,
|
||||
ac_nir_prerast_out *out);
|
||||
ac_nir_gather_prerast_store_output_info(nir_builder *b, nir_intrinsic_instr *intrin,
|
||||
ac_nir_prerast_out *out, bool gather_values);
|
||||
|
||||
void
|
||||
ac_nir_export_primitive(nir_builder *b, nir_def *prim, nir_def *row);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ gather_outputs(nir_builder *b, nir_function_impl *impl, ac_nir_prerast_out *out)
|
|||
if (intrin->intrinsic != nir_intrinsic_store_output)
|
||||
continue;
|
||||
|
||||
ac_nir_gather_prerast_store_output_info(b, intrin, out);
|
||||
ac_nir_gather_prerast_store_output_info(b, intrin, out, true);
|
||||
nir_instr_remove(instr);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1541,7 +1541,7 @@ ngg_nogs_gather_outputs(nir_builder *b, struct exec_list *cf_list, lower_ngg_nog
|
|||
if (intrin->intrinsic != nir_intrinsic_store_output)
|
||||
continue;
|
||||
|
||||
ac_nir_gather_prerast_store_output_info(b, intrin, &s->out);
|
||||
ac_nir_gather_prerast_store_output_info(b, intrin, &s->out, true);
|
||||
nir_instr_remove(instr);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ ngg_gs_clear_primflags(nir_builder *b, nir_def *num_vertices, unsigned stream, l
|
|||
static bool
|
||||
lower_ngg_gs_store_output(nir_builder *b, nir_intrinsic_instr *intrin, lower_ngg_gs_state *s)
|
||||
{
|
||||
ac_nir_gather_prerast_store_output_info(b, intrin, &s->out);
|
||||
ac_nir_gather_prerast_store_output_info(b, intrin, &s->out, true);
|
||||
nir_instr_remove(&intrin->instr);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,8 @@ ac_nir_calc_io_off(nir_builder *b, unsigned component, nir_def *io_offset, nir_d
|
|||
* - 64-bit outputs are lowered
|
||||
* - no indirect indexing is present
|
||||
*/
|
||||
void ac_nir_gather_prerast_store_output_info(nir_builder *b, nir_intrinsic_instr *intrin, ac_nir_prerast_out *out)
|
||||
void ac_nir_gather_prerast_store_output_info(nir_builder *b, nir_intrinsic_instr *intrin,
|
||||
ac_nir_prerast_out *out, bool gather_values)
|
||||
{
|
||||
assert(intrin->intrinsic == nir_intrinsic_store_output);
|
||||
assert(nir_src_is_const(intrin->src[1]) && !nir_src_as_uint(intrin->src[1]));
|
||||
|
|
@ -155,16 +156,19 @@ void ac_nir_gather_prerast_store_output_info(nir_builder *b, nir_intrinsic_instr
|
|||
nir_def *store_component = nir_channel(b, intrin->src[0].ssa, i);
|
||||
|
||||
if (non_dedicated_16bit) {
|
||||
if (io_sem.high_16bits) {
|
||||
nir_def *lo = output[c] ? nir_unpack_32_2x16_split_x(b, output[c]) : nir_imm_intN_t(b, 0, 16);
|
||||
output[c] = nir_pack_32_2x16_split(b, lo, store_component);
|
||||
} else {
|
||||
nir_def *hi = output[c] ? nir_unpack_32_2x16_split_y(b, output[c]) : nir_imm_intN_t(b, 0, 16);
|
||||
output[c] = nir_pack_32_2x16_split(b, store_component, hi);
|
||||
if (gather_values) {
|
||||
if (io_sem.high_16bits) {
|
||||
nir_def *lo = output[c] ? nir_unpack_32_2x16_split_x(b, output[c]) : nir_imm_intN_t(b, 0, 16);
|
||||
output[c] = nir_pack_32_2x16_split(b, lo, store_component);
|
||||
} else {
|
||||
nir_def *hi = output[c] ? nir_unpack_32_2x16_split_y(b, output[c]) : nir_imm_intN_t(b, 0, 16);
|
||||
output[c] = nir_pack_32_2x16_split(b, store_component, hi);
|
||||
}
|
||||
}
|
||||
type[c] = nir_type_uint32;
|
||||
} else {
|
||||
output[c] = store_component;
|
||||
if (gather_values)
|
||||
output[c] = store_component;
|
||||
type[c] = src_type;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue