tu: Use an input for the layer when lowering input attachments

Also remove a hack that's no longer needed. This should fix input
attachments with layered rendering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5719>
This commit is contained in:
Connor Abbott 2020-07-01 17:21:47 +02:00 committed by Marge Bot
parent c77716294b
commit 76f711d09d
1 changed files with 1 additions and 8 deletions

View File

@ -354,13 +354,6 @@ lower_intrinsic(nir_builder *b, nir_intrinsic_instr *instr,
const struct tu_pipeline_layout *layout)
{
switch (instr->intrinsic) {
case nir_intrinsic_load_layer_id:
/* TODO: remove this when layered rendering is implemented */
nir_ssa_def_rewrite_uses(&instr->dest.ssa,
nir_src_for_ssa(nir_imm_int(b, 0)));
nir_instr_remove(&instr->instr);
return true;
case nir_intrinsic_load_push_constant:
lower_load_push_constant(b, instr, shader);
return true;
@ -774,7 +767,7 @@ tu_shader_create(struct tu_device *dev,
NIR_PASS_V(nir, nir_lower_input_attachments,
&(nir_input_attachment_options) {
.use_fragcoord_sysval = true,
.use_layer_id_sysval = true,
.use_layer_id_sysval = false,
});
}