mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
tu: Set use_layer_id_sysval for nir_lower_input_attachments
We can just use nir_lower_sysvals_to_varyings instead. Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38562>
This commit is contained in:
parent
b02a98d7d8
commit
5bbbf5cf9b
1 changed files with 7 additions and 1 deletions
|
|
@ -2782,7 +2782,7 @@ tu_shader_create(struct tu_device *dev,
|
|||
if (nir->info.stage == MESA_SHADER_FRAGMENT) {
|
||||
const nir_input_attachment_options att_options = {
|
||||
.use_fragcoord_sysval = true,
|
||||
.use_layer_id_sysval = false,
|
||||
.use_layer_id_sysval = true,
|
||||
/* When using multiview rendering, we must use
|
||||
* gl_ViewIndex as the layer id to pass to the texture
|
||||
* sampling function. gl_Layer doesn't work when
|
||||
|
|
@ -2797,6 +2797,12 @@ tu_shader_create(struct tu_device *dev,
|
|||
key->unscaled_input_fragcoord,
|
||||
};
|
||||
NIR_PASS(_, nir, nir_lower_input_attachments, &att_options);
|
||||
|
||||
const nir_lower_sysvals_to_varyings_options sysval_options = {
|
||||
.layer_id = true,
|
||||
.view_index = true,
|
||||
};
|
||||
NIR_PASS(_, nir, nir_lower_sysvals_to_varyings, &sysval_options);
|
||||
}
|
||||
|
||||
/* This has to happen before lower_input_attachments, because we have to
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue