summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVäinö Mäkelä <vaino.o.makela@gmail.com>2023-02-21 14:39:21 +0200
committerEric Engestrom <eric@engestrom.ch>2023-03-08 18:00:14 +0000
commit0b388d97dafdc854bb27a2c063b3bc2327fac9ec (patch)
tree400ab7d3551fc667cc22b9a9b2d22395fccbe3d2
parent4a106e32cc8c173a4b6ee8418594d4dafddb3866 (diff)
downloadmesa-0b388d97dafdc854bb27a2c063b3bc2327fac9ec.tar.gz
hasvk: Disable non-zero fast clears for 8xMSAA images
Using texelFetch to read samples from an 8xMSAA fast cleared image on Haswell can read transparent black pixels around triangles from where there should be none. This issue isn't present when using sample shading, resolving the image using vkCmdResolveImage or in a copy the image. The easiest way to fix this is by just disabling non-zero fast clears for 8xMSAA images. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7587 Cc: mesa-stable Reviewed-by: Filip Gawin <filip@gawin.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21444> (cherry picked from commit e509afacf3fb277f944f6d4ebf9d88d4a27c6df6)
-rw-r--r--.pick_status.json2
-rw-r--r--src/intel/vulkan_hasvk/anv_image.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index e8eacb3f288..1e5df2fa080 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -3487,7 +3487,7 @@
"description": "hasvk: Disable non-zero fast clears for 8xMSAA images",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null
},
diff --git a/src/intel/vulkan_hasvk/anv_image.c b/src/intel/vulkan_hasvk/anv_image.c
index f10f46454d7..807c897cbda 100644
--- a/src/intel/vulkan_hasvk/anv_image.c
+++ b/src/intel/vulkan_hasvk/anv_image.c
@@ -375,6 +375,13 @@ can_fast_clear_with_non_zero_color(const struct intel_device_info *devinfo,
uint32_t plane,
const VkImageFormatListCreateInfo *fmt_list)
{
+ /* Triangles rendered on non-zero fast cleared images with 8xMSAA can get
+ * black pixels around them on Haswell.
+ */
+ if (devinfo->ver == 7 && image->vk.samples == 8) {
+ return false;
+ }
+
/* If we don't have an AUX surface where fast clears apply, we can return
* early.
*/