From 9aed388242edb3777b70bb75d9b87c42154c82d8 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 4 Jun 2019 11:32:00 +0300 Subject: [PATCH] - disabled discard in FXAA shader with Vulkan backend Discard caused graphical corruptions on AMD hardware with Vulkan backend enabled https://forum.zdoom.org/viewtopic.php?t=64230 --- src/rendering/hwrenderer/postprocessing/hw_postprocess.cpp | 6 ++++-- wadsrc/static/shaders/glsl/fxaa.fp | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rendering/hwrenderer/postprocessing/hw_postprocess.cpp b/src/rendering/hwrenderer/postprocessing/hw_postprocess.cpp index 9eb64a1d014..20244c9018c 100644 --- a/src/rendering/hwrenderer/postprocessing/hw_postprocess.cpp +++ b/src/rendering/hwrenderer/postprocessing/hw_postprocess.cpp @@ -389,6 +389,7 @@ FString PPFXAA::GetDefines() } const int gatherAlpha = GetMaxVersion() >= 400 ? 1 : 0; + const int discard = screen->IsVulkan() ? 0 : 1; // TODO: enable FXAA_GATHER4_ALPHA on OpenGL earlier than 4.0 // when GL_ARB_gpu_shader5/GL_NV_gpu_shader5 extensions are supported @@ -396,8 +397,9 @@ FString PPFXAA::GetDefines() FString result; result.Format( "#define FXAA_QUALITY__PRESET %i\n" - "#define FXAA_GATHER4_ALPHA %i\n", - quality, gatherAlpha); + "#define FXAA_GATHER4_ALPHA %i\n" + "#define FXAA_DISCARD %i\n", + quality, gatherAlpha, discard); return result; } diff --git a/wadsrc/static/shaders/glsl/fxaa.fp b/wadsrc/static/shaders/glsl/fxaa.fp index ab1d1ad4785..220095ae10c 100644 --- a/wadsrc/static/shaders/glsl/fxaa.fp +++ b/wadsrc/static/shaders/glsl/fxaa.fp @@ -52,8 +52,6 @@ void main() // NVIDIA FXAA 3.11 by TIMOTHY LOTTES //============================================================================ -#define FXAA_DISCARD 1 - #define FXAA_GREEN_AS_LUMA 0 #define FxaaBool bool