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.
This commit is contained in:
Alex Szpakowski
2018-11-12 15:20:09 -04:00
parent da23448efe
commit 5143926b38
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -13,6 +13,7 @@ Released: N/A
* Fixed the explicit format + Data argument variant of love.data.decompress. * Fixed the explicit format + Data argument variant of love.data.decompress.
* Fixed love.joystick.setGamepadMapping not being able to change existing mappings. * 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 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. * Fixed a love.graphics.setCanvas error message to be less confusing.
LOVE 11.1 [Mysterious Mysteries] LOVE 11.1 [Mysterious Mysteries]
+1
View File
@@ -148,6 +148,7 @@ void Shader::mapActiveUniforms()
if (oldu != olduniforms.end()) if (oldu != olduniforms.end())
{ {
u.data = oldu->second.data; u.data = oldu->second.data;
u.dataSize = oldu->second.dataSize;
u.textures = oldu->second.textures; u.textures = oldu->second.textures;
updateUniform(&u, u.count, true); updateUniform(&u, u.count, true);