lavapipe: add input attachment support for multiview
authorDave Airlie <airlied@redhat.com>
Thu, 4 Mar 2021 04:01:06 +0000 (14:01 +1000)
committerMarge Bot <eric+marge@anholt.net>
Fri, 12 Mar 2021 05:05:51 +0000 (05:05 +0000)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9399>

src/gallium/frontends/lavapipe/lvp_lower_input_attachments.c

index 98d4e2a..b1e7cd6 100644 (file)
@@ -70,9 +70,9 @@ try_lower_input_load(nir_function_impl *impl, nir_intrinsic_instr *load,
    nir_ssa_def *offset = nir_ssa_for_src(&b, load->src[1], 2);
    nir_ssa_def *pos = nir_iadd(&b, frag_coord, offset);
 
-   nir_ssa_def *layer = nir_imm_int(&b, 0);
+   nir_ssa_def *layer = nir_load_view_index(&b);
    nir_ssa_def *coord =
-      nir_vec4(&b, nir_channel(&b, pos, 0), nir_channel(&b, pos, 1), layer, layer);
+      nir_vec4(&b, nir_channel(&b, pos, 0), nir_channel(&b, pos, 1), layer, nir_imm_int(&b, 0));
 
    nir_instr_rewrite_src(&load->instr, &load->src[1], nir_src_for_ssa(coord));