Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
Improved text atlas usage logging
Browse files Browse the repository at this point in the history
  • Loading branch information
darthdeus committed Apr 28, 2024
1 parent 2e22477 commit 4987c30
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# EXAMPLE=egui
# EXAMPLE=exr-hdr-image
# EXAMPLE=full_game_loop
EXAMPLE=fullscreen
# EXAMPLE=fullscreen
# EXAMPLE=framerate_vsync
# EXAMPLE=fragment-shader
# EXAMPLE=music
Expand All @@ -31,7 +31,7 @@ EXAMPLE=fullscreen
# EXAMPLE=sprite
# EXAMPLE=shapes
# EXAMPLE=sound
# EXAMPLE=text
EXAMPLE=text
# EXAMPLE=timed_draw
# EXAMPLE=version
# EXAMPLE=y_sort
Expand Down
11 changes: 10 additions & 1 deletion comfy-wgpu/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,16 @@ impl TextRasterizer {
))
.unwrap_or_else(|| panic!("FAILED TO FIT GLYPH {}", c));

info!("still have {} free space", self.atlas.free_space());
if self.atlas.free_space() < self.atlas.allocated_space() {
let used = self.atlas.free_space();
let total = self.atlas.size().area();
info!(
"font atlas has {}/{} space ({:.2}%) used",
used,
total,
(1.0 - used as f32 / total as f32) * 100.0
);
}

let rect = allocation.rectangle.to_rect();
let inset_rect = IRect::new(
Expand Down

0 comments on commit 4987c30

Please sign in to comment.