From f3657903c9c5f76d6f87d8af37c61708d7f27396 Mon Sep 17 00:00:00 2001 From: Imbris Date: Tue, 15 Jun 2021 02:02:10 -0400 Subject: [PATCH] [iced renderer] Skip content processing if the clip intersection is zero sized or invalid --- voxygen/src/ui/ice/renderer/mod.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/voxygen/src/ui/ice/renderer/mod.rs b/voxygen/src/ui/ice/renderer/mod.rs index 83eb8f1320..ae83454051 100644 --- a/voxygen/src/ui/ice/renderer/mod.rs +++ b/voxygen/src/ui/ice/renderer/mod.rs @@ -711,14 +711,9 @@ impl IcedRenderer { if intersection.is_valid() && intersection.size().map(|s| s > 0).reduce_and() { intersection } else { - // Create a aabr with width 1 and height 1, technically - // it would be more correct to do it with 0,0 but that's - // a validation error in wgpu so enjoy your funky pixel - // in the top left of your screen - Aabr { - min: Vec2::zero(), - max: Vec2::one(), - } + // If the intersection is invalid or zero sized we don't need to process + // the content primitive + return; } }; // Not expecting this case: new_scissor == current_scissor @@ -737,8 +732,8 @@ impl IcedRenderer { self.draw_commands.push(DrawCommand::Scissor(new_scissor)); // TODO: support nested clips? - // TODO: if last command is a clip changing back to the default replace it with - // this + // TODO: if previous command was a clip changing back to the default replace it + // with this // TODO: cull primitives outside the current scissor // Renderer child