From 7f887111868f2463ea8cdc8c4b28f96b19bf4bcd Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 25 May 2017 23:59:23 +1000 Subject: [PATCH] Vulkan: Add a driver bug for NV when MSAA is enabled This causes the card to lock up when vkCmdClearAttachments is called, when multisampling is enabled. Seems to be restricted to Maxwell and newer? --- Source/Core/VideoBackends/Vulkan/Renderer.cpp | 3 +++ Source/Core/VideoCommon/DriverDetails.cpp | 4 +++- Source/Core/VideoCommon/DriverDetails.h | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoBackends/Vulkan/Renderer.cpp b/Source/Core/VideoBackends/Vulkan/Renderer.cpp index 3037e3e5f4..5f79897842 100644 --- a/Source/Core/VideoBackends/Vulkan/Renderer.cpp +++ b/Source/Core/VideoBackends/Vulkan/Renderer.cpp @@ -33,6 +33,7 @@ #include "VideoCommon/AVIDump.h" #include "VideoCommon/BPFunctions.h" #include "VideoCommon/BPMemory.h" +#include "VideoCommon/DriverDetails.h" #include "VideoCommon/OnScreenDisplay.h" #include "VideoCommon/PixelEngine.h" #include "VideoCommon/PixelShaderManager.h" @@ -391,6 +392,8 @@ void Renderer::ClearScreen(const EFBRectangle& rc, bool color_enable, bool alpha // Fast path: Use vkCmdClearAttachments to clear the buffers within a render path // We can't use this when preserving alpha but clearing color. + if (g_ActiveConfig.iMultisamples == 1 || + !DriverDetails::HasBug(DriverDetails::BUG_BROKEN_MSAA_VKCMDCLEARATTACHMENTS)) { VkClearAttachment clear_attachments[2]; uint32_t num_clear_attachments = 0; diff --git a/Source/Core/VideoCommon/DriverDetails.cpp b/Source/Core/VideoCommon/DriverDetails.cpp index fb12fc04b8..8db1a595b8 100644 --- a/Source/Core/VideoCommon/DriverDetails.cpp +++ b/Source/Core/VideoCommon/DriverDetails.cpp @@ -101,7 +101,9 @@ static BugInfo m_known_bugs[] = { {API_OPENGL, OS_LINUX, VENDOR_MESA, DRIVER_I965, Family::UNKNOWN, BUG_SHARED_CONTEXT_SHADER_COMPILATION, -1.0, -1.0, true}, {API_OPENGL, OS_LINUX, VENDOR_MESA, DRIVER_NOUVEAU, Family::UNKNOWN, - BUG_SHARED_CONTEXT_SHADER_COMPILATION, -1.0, -1.0, true}}; + BUG_SHARED_CONTEXT_SHADER_COMPILATION, -1.0, -1.0, true}, + {API_VULKAN, OS_ALL, VENDOR_NVIDIA, DRIVER_NVIDIA, Family::UNKNOWN, + BUG_BROKEN_MSAA_VKCMDCLEARATTACHMENTS, -1.0, -1.0, true}}; static std::map m_bugs; diff --git a/Source/Core/VideoCommon/DriverDetails.h b/Source/Core/VideoCommon/DriverDetails.h index d256b51918..a57071ef68 100644 --- a/Source/Core/VideoCommon/DriverDetails.h +++ b/Source/Core/VideoCommon/DriverDetails.h @@ -253,6 +253,12 @@ enum Bug // Started version: -1 // Ended Version: -1 BUG_SHARED_CONTEXT_SHADER_COMPILATION, + + // Bug: vkCmdClearAttachments with MSAA enabled causes NVIDIA Maxwell+ cards to lock up. + // Started version: -1 + // Ended version: -1 + // Seems to only occur when the top of the clear rect is non-zero. + BUG_BROKEN_MSAA_VKCMDCLEARATTACHMENTS, }; // Initializes our internal vendor, device family, and driver version