From 1b5f3da9c59e0b59aefb6c8b5c0e2cc74d005b2c Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 3 Jul 2017 01:50:51 +0200 Subject: [PATCH] - Fix lump lookup --- src/gl/renderer/gl_postprocess.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gl/renderer/gl_postprocess.cpp b/src/gl/renderer/gl_postprocess.cpp index 2a5c1b829..570a43ffc 100644 --- a/src/gl/renderer/gl_postprocess.cpp +++ b/src/gl/renderer/gl_postprocess.cpp @@ -42,6 +42,7 @@ #include "r_utility.h" #include "p_local.h" #include "colormatcher.h" +#include "w_wad.h" #include "gl/gl_functions.h" #include "gl/system/gl_interface.h" #include "gl/system/gl_framebuffer.h" @@ -188,9 +189,14 @@ void FGLRenderer::RunCustomPostProcessShaders(FString target) if (!shader.Instance) { + const char *lumpName = shader.ShaderLumpName.GetChars(); + int lump = Wads.CheckNumForFullName(lumpName); + if (lump == -1) I_FatalError("Unable to load '%s'", lumpName); + FString code = Wads.ReadLump(lump).GetString().GetChars(); + shader.Instance = std::make_shared(); shader.Instance->Program.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); // Hmm, should this use shader.shaderversion? - shader.Instance->Program.Compile(FShaderProgram::Fragment, shader.ShaderLumpName.GetChars(), "", shader.ShaderVersion); + shader.Instance->Program.Compile(FShaderProgram::Fragment, lumpName, code, "", shader.ShaderVersion); shader.Instance->Program.SetFragDataLocation(0, "FragColor"); shader.Instance->Program.Link(shader.ShaderLumpName.GetChars()); shader.Instance->Program.SetAttribLocation(0, "PositionInProjection");