llvmpipe/fs: multisample depth/stencil bad ir generated
authorDave Airlie <airlied@redhat.com>
Fri, 19 Jun 2020 06:57:16 +0000 (16:57 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 31 Aug 2020 03:20:11 +0000 (13:20 +1000)
Need to update the z value after updating the pos at pixel
center, and later reupdate it again, so we can avoid some
LLVM IR values not being dominant issues.

Fixes:
dEQP-VK.renderpass.suballocation.multisample.s8_uint.samples_4

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>

src/gallium/drivers/llvmpipe/lp_state_fs.c

index 804ed9214c628936721f98c8012440bbcb5bf0d9..c57f2d4e6ee212ff61a8bcc1aab35218a478be79 100644 (file)
@@ -881,6 +881,7 @@ generate_fs_loop(struct gallivm_state *gallivm,
       if (key->min_samples == 1) {
          /* for multisample Z needs to be re interpolated at pixel center */
          lp_build_interp_soa_update_pos_dyn(interp, gallivm, loop_state.counter, NULL);
+         z = interp->pos[2];
          lp_build_mask_update(&mask, tmp_s_mask_or);
       }
    } else {
@@ -1119,6 +1120,11 @@ generate_fs_loop(struct gallivm_state *gallivm,
                                           0);
       if (pos0 != -1 && outputs[pos0][2]) {
          z = LLVMBuildLoad(builder, outputs[pos0][2], "output.z");
+      } else {
+         if (key->multisample) {
+            lp_build_interp_soa_update_pos_dyn(interp, gallivm, loop_state.counter, key->multisample ? sample_loop_state.counter : NULL);
+            z = interp->pos[2];
+         }
       }
       /*
        * Clamp according to ARB_depth_clamp semantics.