PostProcessing/FX: Fix GLSL compile error with discard

This commit is contained in:
Stenzek 2024-03-24 20:48:04 +10:00
parent 9cdff4781f
commit 101ebe3ac3
No known key found for this signature in database
1 changed files with 2 additions and 1 deletions

View File

@ -1170,7 +1170,8 @@ bool PostProcessing::ReShadeFXShader::CompilePipeline(GPUTexture::Format format,
if (needs_main_defn)
{
// dFdx/dFdy are not defined in the vertex shader.
const char* defns = (stage == GPUShaderStage::Vertex) ? "#define dFdx(x) x\n#define dFdy(x) x\n" : "";
const char* defns =
(stage == GPUShaderStage::Vertex) ? "#define dFdx(x) x\n#define dFdy(x) x\n#define discard\n" : "";
const char* precision = (api == RenderAPI::OpenGLES) ?
"precision highp float;\nprecision highp int;\nprecision highp sampler2D;\n" :
"";