nvir/nir: fix fragment program output when using MRT
authorBen Skeggs <bskeggs@redhat.com>
Sat, 6 Jun 2020 23:52:02 +0000 (09:52 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 10 Jun 2020 22:52:41 +0000 (22:52 +0000)
v2:
- use BITFIELD64_BIT()

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5377>

src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp

index c058eea2354df01d6db88f957e946b6fc9555573..32eac3f26d226e7928809b6c1d12c0ae4ce829f8 100644 (file)
@@ -1067,7 +1067,11 @@ bool Converter::assignSlots() {
          case TGSI_SEMANTIC_COLOR:
             if (!var->data.fb_fetch_output)
                info->prop.fp.numColourResults++;
-            info->prop.fp.separateFragData = true;
+
+            if (var->data.location == FRAG_RESULT_COLOR &&
+                nir->info.outputs_written & BITFIELD64_BIT(var->data.location))
+               info->prop.fp.separateFragData = true;
+
             // sometimes we get FRAG_RESULT_DATAX with data.index 0
             // sometimes we get FRAG_RESULT_DATA0 with data.index X
             index = index == 0 ? var->data.index : index;