summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorOatmealDome <OatmealDome@users.noreply.github.com>2026-04-02 23:55:16 -0400
committerGitHub <noreply@github.com>2026-04-02 23:55:16 -0400
commit5e95d5e7f56aa4b758f4e758dabf8a716a20cc85 (patch)
tree25bc1799049bc3ded7810ee6d16975d6925d7238 /Source/Core/VideoCommon
parent0531286906ec65edf3736813517496c95bf87ada (diff)
parent26e58ea3492d0bb3004359b9a72f3a738f3c2134 (diff)
Merge pull request #14492 from OatmealDome/apple-discard-bug-fixed-3
VideoBackends/Vulkan: Drop BUG_BROKEN_DISCARD_WITH_EARLY_Z workaround
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/DriverDetails.cpp18
-rw-r--r--Source/Core/VideoCommon/UberShaderPixel.cpp3
2 files changed, 18 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/DriverDetails.cpp b/Source/Core/VideoCommon/DriverDetails.cpp
index 705bd66bab..b657d7721c 100644
--- a/Source/Core/VideoCommon/DriverDetails.cpp
+++ b/Source/Core/VideoCommon/DriverDetails.cpp
@@ -7,6 +7,10 @@
#include "Core/DolphinAnalytics.h"
+#ifdef __APPLE__
+#include "Common/CommonFuncs.h"
+#endif
+
namespace DriverDetails
{
struct BugInfo
@@ -148,9 +152,9 @@ constexpr BugInfo m_known_bugs[] = {
{API_VULKAN, OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, BUG_PRIMITIVE_RESTART,
-1.0, -1.0, true},
{API_VULKAN, OS_OSX, VENDOR_APPLE, DRIVER_PORTABILITY, Family::UNKNOWN,
- BUG_BROKEN_DISCARD_WITH_EARLY_Z, -1.0, -1.0, true},
+ BUG_BROKEN_DISCARD_WITH_EARLY_Z, 1100, 1400, true},
{API_METAL, OS_OSX, VENDOR_APPLE, DRIVER_APPLE, Family::UNKNOWN,
- BUG_BROKEN_DISCARD_WITH_EARLY_Z, -1.0, -1.0, true},
+ BUG_BROKEN_DISCARD_WITH_EARLY_Z, 1100, 1400, true},
{API_VULKAN, OS_OSX, VENDOR_INTEL, DRIVER_PORTABILITY, Family::UNKNOWN,
BUG_BROKEN_DYNAMIC_SAMPLER_INDEXING, -1.0, -1.0, true},
{API_METAL, OS_OSX, VENDOR_INTEL, DRIVER_APPLE, Family::UNKNOWN,
@@ -198,6 +202,16 @@ void Init(API api, Vendor vendor, Driver driver, const double version, const Fam
}
}
+#ifdef __APPLE__
+ // The Metal graphics drivers are part of macOS, so we use the current macOS version as the
+ // driver version for Metal and Vulkan on Metal.
+ if (api == API_METAL || (api == API_VULKAN && driver == DRIVER_PORTABILITY))
+ {
+ Common::MacOSVersion mac_version = Common::GetMacOSVersion();
+ m_version = mac_version.major * 100 + mac_version.minor;
+ }
+#endif
+
// Clear bug list, as the API may have changed
m_bugs.clear();
diff --git a/Source/Core/VideoCommon/UberShaderPixel.cpp b/Source/Core/VideoCommon/UberShaderPixel.cpp
index be6571ff7f..3370f878ad 100644
--- a/Source/Core/VideoCommon/UberShaderPixel.cpp
+++ b/Source/Core/VideoCommon/UberShaderPixel.cpp
@@ -1005,7 +1005,8 @@ ShaderCode GenPixelShader(APIType api_type, const ShaderHostConfig& host_config,
out.Write(" // Alpha Test\n");
- if (early_depth && DriverDetails::HasBug(DriverDetails::BUG_BROKEN_DISCARD_WITH_EARLY_Z))
+ if (early_depth && DriverDetails::HasBug(DriverDetails::BUG_BROKEN_DISCARD_WITH_EARLY_Z) &&
+ host_config.backend_shader_framebuffer_fetch)
{
// Instead of using discard, fetch the framebuffer's color value and use it as the output
// for this fragment.