- fix saved texture bindings to work for any number of binds

This commit is contained in:
Magnus Norddahl 2018-07-01 14:31:30 +02:00
parent 5b3212df13
commit 4482ad2b78

View file

@ -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;