From d5933daee5328d3ca37741c0642d09a1e71232fb Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 24 Aug 2022 14:34:34 +0200 Subject: [PATCH] egui_glow: allow empty (zero-sized) textures See https://github.com/emilk/egui/issues/1960 --- crates/eframe/CHANGELOG.md | 2 ++ crates/egui_glow/CHANGELOG.md | 1 + crates/egui_glow/src/painter.rs | 6 ------ 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/eframe/CHANGELOG.md b/crates/eframe/CHANGELOG.md index f71046c3..130ef4f3 100644 --- a/crates/eframe/CHANGELOG.md +++ b/crates/eframe/CHANGELOG.md @@ -7,6 +7,8 @@ NOTE: [`egui-winit`](../egui-winit/CHANGELOG.md), [`egui_glium`](../egui_glium/C ## Unreleased * Added `NativeOptions::event_loop_builder` hook for apps to change platform specific event loop options ([#1952](https://github.com/emilk/egui/pull/1952)). * Enabled deferred render state initialization to support Android ([#1952](https://github.com/emilk/egui/pull/1952)). +* Allow empty textures with the glow renderer. + ## 0.19.0 - 2022-08-20 * MSRV (Minimum Supported Rust Version) is now `1.61.0` ([#1846](https://github.com/emilk/egui/pull/1846)). diff --git a/crates/egui_glow/CHANGELOG.md b/crates/egui_glow/CHANGELOG.md index a5841b34..4ded9e0c 100644 --- a/crates/egui_glow/CHANGELOG.md +++ b/crates/egui_glow/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to the `egui_glow` integration will be noted in this file. ## Unreleased +* Allow empty textures. ## 0.19.0 - 2022-08-20 diff --git a/crates/egui_glow/src/painter.rs b/crates/egui_glow/src/painter.rs index 7338cf8a..5a383562 100644 --- a/crates/egui_glow/src/painter.rs +++ b/crates/egui_glow/src/painter.rs @@ -552,12 +552,6 @@ impl Painter { data: &[u8], ) { assert_eq!(data.len(), w * h * 4); - assert!( - w >= 1 && h >= 1, - "Got a texture image of size {}x{}. A texture must at least be one texel wide.", - w, - h - ); assert!( w <= self.max_texture_side && h <= self.max_texture_side, "Got a texture image of size {}x{}, but the maximum supported texture side is only {}",