Skip to content

Commit

Permalink
- disabled discard in FXAA shader with Vulkan backend
Browse files Browse the repository at this point in the history
Discard caused graphical corruptions on AMD hardware with Vulkan backend enabled

https://forum.zdoom.org/viewtopic.php?t=64230
  • Loading branch information
alexey-lysiuk authored and madame-rachelle committed Jun 7, 2019
1 parent 405ac16 commit 9aed388
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/rendering/hwrenderer/postprocessing/hw_postprocess.cpp
Expand Up @@ -389,15 +389,17 @@ 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

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;
}
Expand Down
2 changes: 0 additions & 2 deletions wadsrc/static/shaders/glsl/fxaa.fp
Expand Up @@ -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
Expand Down

0 comments on commit 9aed388

Please sign in to comment.