From 5143926b384cc463c1f6f90ec1e6933916583b06 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 12 Nov 2018 15:20:09 -0400 Subject: [PATCH] Copy the data size of old uniforms to the new uniform when reinitializing shader uniforms after love.window.setMode. Fixes a crash in the Data variant of Shader:send when it's called after setMode on a shader that was created before the setMode call. --- changes.txt | 1 + src/modules/graphics/opengl/Shader.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/changes.txt b/changes.txt index 0db6c8578..fd8b554b6 100644 --- a/changes.txt +++ b/changes.txt @@ -13,6 +13,7 @@ Released: N/A * Fixed the explicit format + Data argument variant of love.data.decompress. * Fixed love.joystick.setGamepadMapping not being able to change existing mappings. * Fixed a crash on quit on Linux if a custom cursor is active when quitting. +* Fixed a crash in the Data variant of Shader:send when it's called after love.window.setMode. * Fixed a love.graphics.setCanvas error message to be less confusing. LOVE 11.1 [Mysterious Mysteries] diff --git a/src/modules/graphics/opengl/Shader.cpp b/src/modules/graphics/opengl/Shader.cpp index 8972d97c4..4445fa30f 100644 --- a/src/modules/graphics/opengl/Shader.cpp +++ b/src/modules/graphics/opengl/Shader.cpp @@ -148,6 +148,7 @@ void Shader::mapActiveUniforms() if (oldu != olduniforms.end()) { u.data = oldu->second.data; + u.dataSize = oldu->second.dataSize; u.textures = oldu->second.textures; updateUniform(&u, u.count, true);