From 69c3466da1331c6a00b290bd72489935a1831cca Mon Sep 17 00:00:00 2001 From: Vedran Maric <36032062+vdrn@users.noreply.github.com> Date: Sun, 14 Apr 2024 13:07:23 +0200 Subject: [PATCH] Fix resizing managed textures Resizing texture does not update its size params (since `self.textures.get(..)` returns a `Copy`) --- src/graphics/gl.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/graphics/gl.rs b/src/graphics/gl.rs index f111bae3..1ae6753c 100644 --- a/src/graphics/gl.rs +++ b/src/graphics/gl.rs @@ -877,6 +877,12 @@ impl RenderingBackend for GlContext { ) { let mut t = self.textures.get(texture); t.resize(self, width, height, source); + match texture.0 { + TextureIdInner::Managed(tex_id) => { + self.textures.0[tex_id].params = t.params; + } + _ => {} + }; } fn texture_read_pixels(&mut self, texture: TextureId, source: &mut [u8]) { let t = self.textures.get(texture);