From 4482ad2b787dd382337ac868ee2d7c800aaf989e Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 1 Jul 2018 14:31:30 +0200 Subject: [PATCH] - fix saved texture bindings to work for any number of binds --- src/gl/renderer/gl_renderbuffers.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gl/renderer/gl_renderbuffers.cpp b/src/gl/renderer/gl_renderbuffers.cpp index d8c1831d6..fa8611af0 100644 --- a/src/gl/renderer/gl_renderbuffers.cpp +++ b/src/gl/renderer/gl_renderbuffers.cpp @@ -839,13 +839,14 @@ void FGLRenderBuffers::RenderEffect(const FString &name) FGLDebug::PushGroup(name.GetChars()); FGLPostProcessState savedState; - savedState.SaveTextureBindings(3); for (const PPStep &step : hw_postprocess.Effects[name]) { // Bind input textures for (unsigned int index = 0; index < step.Textures.Size(); index++) { + savedState.SaveTextureBindings(index + 1); + const PPTextureInput &input = step.Textures[index]; int filter = (input.Filter == PPFilterMode::Nearest) ? GL_NEAREST : GL_LINEAR; int wrap = (input.Wrap == PPWrapMode::Clamp) ? GL_CLAMP : GL_REPEAT;