tu: Use an input for the layer when lowering input attachments
authorConnor Abbott <cwabbott0@gmail.com>
Wed, 1 Jul 2020 15:21:47 +0000 (17:21 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 19 Aug 2020 16:36:43 +0000 (16:36 +0000)
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>

src/freedreno/vulkan/tu_shader.c

index 3820f8877eec4ca605c294d5faaca93394d0970b..4461bae26d0cd4e44406199ffc470c30a5710a78 100644 (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,
                  });
    }