mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 16:00:08 +01:00
anv/brw/iris: move VS VUE computation to backend
Drivers can provide the inputs required for the backend to call the compute function. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Ivan Briano <ivan.briano@intel.com> Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34872>
This commit is contained in:
parent
8dee4813b0
commit
a18835a9ca
6 changed files with 41 additions and 20 deletions
|
|
@ -1884,10 +1884,6 @@ iris_compile_vs(struct iris_screen *screen,
|
|||
|
||||
brw_nir_analyze_ubo_ranges(screen->brw, nir, brw_prog_data->base.base.ubo_ranges);
|
||||
|
||||
brw_compute_vue_map(devinfo,
|
||||
&brw_prog_data->base.vue_map, nir->info.outputs_written,
|
||||
key->vue.layout, /* pos_slots */ 1);
|
||||
|
||||
struct brw_vs_prog_key brw_key = iris_to_brw_vs_key(screen, key);
|
||||
|
||||
struct brw_compile_vs_params params = {
|
||||
|
|
|
|||
|
|
@ -163,6 +163,16 @@ brw_compile_gs(const struct brw_compiler *compiler,
|
|||
&input_vue_map, inputs_read,
|
||||
key->base.vue_layout, 1);
|
||||
|
||||
const uint32_t pos_slots =
|
||||
(nir->info.per_view_outputs & VARYING_BIT_POS) ?
|
||||
MAX2(1, util_bitcount(key->base.view_mask)) : 1;
|
||||
|
||||
brw_compute_vue_map(compiler->devinfo,
|
||||
&prog_data->base.vue_map,
|
||||
nir->info.outputs_written,
|
||||
key->base.vue_layout,
|
||||
pos_slots);
|
||||
|
||||
brw_nir_apply_key(nir, compiler, &key->base, dispatch_width);
|
||||
brw_nir_lower_vue_inputs(nir, &input_vue_map);
|
||||
brw_nir_lower_vue_outputs(nir);
|
||||
|
|
|
|||
|
|
@ -82,9 +82,13 @@ brw_compile_tes(const struct brw_compiler *compiler,
|
|||
brw_postprocess_nir(nir, compiler, debug_enabled,
|
||||
key->base.robust_flags);
|
||||
|
||||
const uint32_t pos_slots =
|
||||
(nir->info.per_view_outputs & VARYING_BIT_POS) ?
|
||||
MAX2(1, util_bitcount(key->base.view_mask)) : 1;
|
||||
|
||||
brw_compute_vue_map(devinfo, &prog_data->base.vue_map,
|
||||
nir->info.outputs_written,
|
||||
key->base.vue_layout, 1);
|
||||
key->base.vue_layout, pos_slots);
|
||||
|
||||
unsigned output_size_bytes = prog_data->base.vue_map.num_slots * 4 * 4;
|
||||
|
||||
|
|
|
|||
|
|
@ -248,6 +248,20 @@ brw_compile_vs(const struct brw_compiler *compiler,
|
|||
|
||||
brw_prog_data_init(&prog_data->base.base, ¶ms->base);
|
||||
|
||||
/* When using Primitive Replication for multiview, each view gets its own
|
||||
* position slot.
|
||||
*/
|
||||
const uint32_t pos_slots =
|
||||
(nir->info.per_view_outputs & VARYING_BIT_POS) ?
|
||||
MAX2(1, util_bitcount(key->base.view_mask)) : 1;
|
||||
|
||||
/* Only position is allowed to be per-view */
|
||||
assert(!(nir->info.per_view_outputs & ~VARYING_BIT_POS));
|
||||
|
||||
brw_compute_vue_map(compiler->devinfo,
|
||||
&prog_data->base.vue_map, nir->info.outputs_written,
|
||||
key->base.vue_layout, pos_slots);
|
||||
|
||||
brw_nir_apply_key(nir, compiler, &key->base, dispatch_width);
|
||||
|
||||
prog_data->inputs_read = nir->info.inputs_read;
|
||||
|
|
|
|||
|
|
@ -219,6 +219,12 @@ enum brw_robustness_flags {
|
|||
struct brw_base_prog_key {
|
||||
unsigned program_string_id;
|
||||
|
||||
/** Multiview mask
|
||||
*
|
||||
* Used to compute the number of position slots in the VUE
|
||||
*/
|
||||
uint32_t view_mask;
|
||||
|
||||
enum brw_robustness_flags robust_flags:2;
|
||||
|
||||
bool uses_inline_push_addr:1;
|
||||
|
|
@ -232,7 +238,7 @@ struct brw_base_prog_key {
|
|||
*/
|
||||
bool limit_trig_input_range:1;
|
||||
|
||||
unsigned padding:26;
|
||||
uint64_t padding:58;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -294,7 +300,7 @@ struct brw_vs_prog_key {
|
|||
*/
|
||||
bool no_vf_slot_compaction : 1;
|
||||
|
||||
uint32_t padding : 30;
|
||||
uint64_t padding : 62;
|
||||
};
|
||||
|
||||
/** The program key for Tessellation Control Shaders. */
|
||||
|
|
@ -421,7 +427,7 @@ struct brw_cs_prog_key {
|
|||
*/
|
||||
bool lower_unaligned_dispatch:1;
|
||||
|
||||
uint32_t padding:31;
|
||||
uint64_t padding:63;
|
||||
};
|
||||
|
||||
struct brw_bs_prog_key {
|
||||
|
|
@ -432,6 +438,8 @@ struct brw_bs_prog_key {
|
|||
* shader.
|
||||
*/
|
||||
uint32_t pipeline_ray_flags;
|
||||
|
||||
uint32_t padding;
|
||||
};
|
||||
|
||||
/* brw_any_prog_key is any of the keys that map to an API stage */
|
||||
|
|
|
|||
|
|
@ -1244,21 +1244,10 @@ anv_pipeline_compile_vs(const struct brw_compiler *compiler,
|
|||
uint32_t view_mask,
|
||||
char **error_str)
|
||||
{
|
||||
/* When using Primitive Replication for multiview, each view gets its own
|
||||
* position slot.
|
||||
*/
|
||||
uint32_t pos_slots =
|
||||
(vs_stage->nir->info.per_view_outputs & VARYING_BIT_POS) ?
|
||||
MAX2(1, util_bitcount(view_mask)) : 1;
|
||||
|
||||
/* Only position is allowed to be per-view */
|
||||
assert(!(vs_stage->nir->info.per_view_outputs & ~VARYING_BIT_POS));
|
||||
|
||||
brw_compute_vue_map(compiler->devinfo,
|
||||
&vs_stage->prog_data.vs.base.vue_map,
|
||||
vs_stage->nir->info.outputs_written,
|
||||
vs_stage->key.base.vue_layout,
|
||||
pos_slots);
|
||||
vs_stage->key.vs.base.view_mask = view_mask;
|
||||
|
||||
vs_stage->num_stats = 1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue