From f6f9dc0cacb0dcbbd09d31acbb6e3a3ece764541 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 2 Aug 2019 19:20:36 +1000 Subject: RenderState: Approximate logic op with blending if unsupported This is a giant hack which was previously removed because it causes broken rendering. However, it seems that some devices still do not support logical operations (looking at you, Adreno/Mali). Therefore, for a handful of cases where the hack actually makes things slightly better, we can use it. ... but not without spamming the log with warnings. With my warning message PR, we can inform the users before emulation starts anyway. --- Source/Core/VideoCommon/ShaderCache.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Source/Core/VideoCommon/ShaderCache.cpp') diff --git a/Source/Core/VideoCommon/ShaderCache.cpp b/Source/Core/VideoCommon/ShaderCache.cpp index 3d4f286b68..e3066520fb 100644 --- a/Source/Core/VideoCommon/ShaderCache.cpp +++ b/Source/Core/VideoCommon/ShaderCache.cpp @@ -558,6 +558,13 @@ AbstractPipelineConfig ShaderCache::GetGXPipelineConfig( config.depth_state = depth_state; config.blending_state = blending_state; config.framebuffer_state = g_framebuffer_manager->GetEFBFramebufferState(); + + if (config.blending_state.logicopenable && !g_ActiveConfig.backend_info.bSupportsLogicOp) + { + WARN_LOG(VIDEO, "Approximating logic op with blending, this will produce incorrect rendering."); + config.blending_state.ApproximateLogicOpWithBlending(); + } + return config; } -- cgit v1.2.3