radv: fix MSAA on SI gpus.
authorDave Airlie <airlied@redhat.com>
Mon, 7 Aug 2017 06:39:41 +0000 (07:39 +0100)
committerDave Airlie <airlied@redhat.com>
Mon, 7 Aug 2017 07:38:14 +0000 (08:38 +0100)
This ports the workaround from radeonsi, that was missing in radv.

This fixes Talos rendering when MSAA is enabled on my Tahiti card.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fixes: f4e499ec7 (radv: add initial non-conformant radv vulkan driver)
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_device.c

index e5bedf32b15c44ab685b7bb38d06991dd1f2c384..85ba165b4c618730bad0a74949ede4ac6b7a07c3 100644 (file)
@@ -3089,9 +3089,13 @@ radv_initialise_color_surface(struct radv_device *device,
                                    format != V_028C70_COLOR_24_8) |
                S_028C70_NUMBER_TYPE(ntype) |
                S_028C70_ENDIAN(endian);
-       if (iview->image->info.samples > 1)
-               if (iview->image->fmask.size)
-                       cb->cb_color_info |= S_028C70_COMPRESSION(1);
+       if ((iview->image->info.samples > 1) && iview->image->fmask.size) {
+               cb->cb_color_info |= S_028C70_COMPRESSION(1);
+               if (device->physical_device->rad_info.chip_class == SI) {
+                       unsigned fmask_bankh = util_logbase2(iview->image->fmask.bank_height);
+                       cb->cb_color_attrib |= S_028C74_FMASK_BANK_HEIGHT(fmask_bankh);
+               }
+       }
 
        if (iview->image->cmask.size &&
            !(device->debug_flags & RADV_DEBUG_NO_FAST_CLEARS))