Commit Graph

168 Commits

Author SHA1 Message Date
Emil Ernerfeldt d50287b83c
Add `taplo.toml` for toml formatting (#7618) 2025-10-09 15:38:00 +02:00
Emil Ernerfeldt 47a437403f
Use software texture filtering in kittest (#7602) 2025-10-08 16:24:02 +02:00
Emil Ernerfeldt 9cb4e6a54e
Create `egui_wgpu::RendererOptions` (#7601) 2025-10-07 17:06:23 +02:00
Emil Ernerfeldt 86dc9ea64e
Inline log format args (#7600) 2025-10-07 16:14:43 +02:00
Andreas Reich 427c0766fd
Update wgpu to 27.0.0 (#7580) 2025-10-03 09:54:46 +02:00
Emil Ernerfeldt bd45406fad
Use a lot more let-else (#7582) 2025-10-02 19:47:00 +02:00
Emil Ernerfeldt 18ea9ff0bd
Warn if `DYLD_LIBRARY_PATH` is set and we find no wgpu adapter (#7572)
Co-authored-by: Andreas Reich <andreas@rerun.io>
2025-09-30 15:56:04 +02:00
Kumpelinus c97c065a57
Update wgpu to 26 and wasm-bindgen to 0.2.100 (#7540)
Co-authored-by: TÖRÖK Attila <torokati44@gmail.com>
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-09-21 20:42:00 +02:00
Emil Ernerfeldt 226bdc4c5b
0.32.3 release: Bump version numbers and update changelog (#7536) 2025-09-12 08:18:19 +02:00
Lucas Meurer 34cd613378
Update changelogs and versions for 0.32.2 (#7505) 2025-09-08 10:42:10 +02:00
Emil Ernerfeldt 6a355c3808 Add 0.32.1 to changelogs 2025-08-15 13:42:49 +02:00
Emil Ernerfeldt 3024c39eaf
Enable and fix some more clippy lints (#7426)
One can never have too many lints
2025-08-08 09:57:53 +02:00
Lucas Meurer 2c6611d0c6
Enable wgpu default features in eframe / egui_wgpu default features (#7344) 2025-08-05 21:21:00 +02:00
Emil Ernerfeldt fabd4aa7a5
Release 0.32.0 - Atoms, popups, and better SVG support (#7329) 2025-07-10 16:58:39 +02:00
Emil Ernerfeldt f46926aaf1
Improve texture filtering by doing it in gamma space (#7311)
* Closes https://github.com/emilk/egui/pull/5839

This makes some transparent images look a lot nicer when blended:


![image](https://github.com/user-attachments/assets/7f370aaf-886a-423c-8391-c378849b63ca)

Cursive text will also look nicer.

This unfortunately changes the contract of what
`register_native_texture` expects

---------

Co-authored-by: Adrian Blumer <blumer.adrian@gmail.com>
2025-07-07 17:46:27 +02:00
valadaptive 7ac137bfc1
Make the font atlas use a color image (#7298)
* [x] I have followed the instructions in the PR template

Splitting this out from the Parley work as requested. This removes
`FontImage` and makes the font atlas use a `ColorImage`. It converts
alpha to coverage at glyph-drawing time, not at delta-upload time.

This doesn't do much now, but will allow for color emoji rendering once
we start using Parley.

I've changed things around so that we pass in `text_alpha_to_coverage`
to the `Fonts` the same way we do with `pixels_per_point` and
`max_texture_side`, reusing the existing code to check if the setting
differs and recreating the font atlas if so. I'm not quite sure why this
wasn't done in the first place.

I've left `ImageData` as an enum for now, in case we want to add support
for more texture pixel formats in the future (which I personally think
would be worthwhile). If you'd like, I can just remove that enum
entirely.
2025-07-04 13:15:48 +02:00
Emil Ernerfeldt dc79998044
Improve text rendering in light mode (#7290)
This changes how we convert glyph coverage to alpha (and ultimately a
color), but only in light mode.

This is a bit of a hack, because it doesn't fix dark-on-light text in
_dark mode_ (if you have any), but for the common case this PR is a huge
improvement.

You can also tweak this yourself now using
`Visuals::text_alpha_from_coverage` or from the UI (bottom of the
image):


![image](https://github.com/user-attachments/assets/350210d4-c0bb-44b6-84cc-47c2e9d4b9f0)



## Before / After

![widget_gallery_light_x1](https://github.com/user-attachments/assets/21f5a2a0-6b4e-4985-b17f-cd1c7cc01b46)
![widget_gallery_light_x1](https://github.com/user-attachments/assets/5dfec04a-c81c-43ef-8d86-fc48ef7958f1)


## Black text Before/after
If you think the text above looks too weak, it's only because of the
default text color. Here's how it looks like with perfectly `#000000`
black text:


![image](https://github.com/user-attachments/assets/56a4a4f3-c431-4991-b941-a566a4ae94ed)
![Screenshot 2025-07-02 at 13 59
30](https://github.com/user-attachments/assets/df5a91ad-0bb8-4a0f-81a2-50852e7556c1)
2025-07-02 14:58:37 +02:00
Emil Ernerfeldt b2995dcb83
Use Rust edition 2024 (#7280) 2025-06-30 14:01:57 +02:00
Emil Ernerfeldt 2cf6a3a9a6
Track original SVG size (#7098)
This fixes bugs related to how an `Image` follows the size of an SVG.

We track the "source size" of each image, i.e. the original width/height
of the SVG, which can be different from whatever it was rasterized as.
2025-05-28 08:33:01 +02:00
Matt Keeter a085d0b3a5
Fix typo in `egpu-wgpu/Cargo.toml` (#7083) 2025-05-25 16:10:39 +02:00
TÖRÖK Attila 773232b139
Update to wgpu 25 (#6744)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-05-10 13:16:49 +02:00
Emil Ernerfeldt d0876a1a60
Rename `master` branch to `main` (#7034)
For consistency with other repositories, i.e. so I can write `git
checkout main` without worrying which repo I'm browsing.
2025-05-08 09:15:42 +02:00
Emil Ernerfeldt f9245954eb
Enable more clippy lints (#6853)
* Follows https://github.com/emilk/egui/pull/6848
2025-04-24 17:32:50 +02:00
Lucas Meurer 159ccb2fef Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
Lucas Meurer 5c372a7b36 Release 0.31.0 - Scene container, improved rendering quality 2025-02-04 16:47:56 +01:00
Andreas Reich 30e66e4575
Wgpu resources are no longer wrapped in `Arc` (since they are now `Clone`) (#5612)
Co-authored-by: Nicolas <bircni@icloud.com>
2025-01-20 18:06:35 +01:00
TÖRÖK Attila a5d7cf5bd7
Upgrade to wgpu 24 (#5610) 2025-01-16 17:00:29 +01:00
Emil Ernerfeldt 164f56f554
Fix some clippy issues found by 1.84.0 (#5603) 2025-01-13 08:29:13 +01:00
Andreas Reich 443df84a22
Extend `WgpuSetup`, `egui_kittest` now prefers software rasterizers for testing (#5506) 2025-01-08 14:24:58 +01:00
lucasmerlin 46b58e5bcc
Add `Harness::new_eframe` and `TestRenderer` trait (#5539)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-01-02 17:48:39 +01:00
Emil Ernerfeldt 320377e3ca
Release 0.30 - egui_kittest and modals (#5487) 2024-12-16 17:45:35 +01:00
Ted de Munnik 3af907919b
Use `profiling` crate to support more profiler backends (#5150)
Hey! I am not sure if this is something that's been considered before
and decided against (I couldn't find any PR's or issues).

This change removes the internal profiling macros in library crates and
the `puffin` feature and replaces it with similar functions in the
[profiling](https://github.com/aclysma/profiling) crate. This crate
provides a layer of abstraction over various profiler instrumentation
crates and allows library users to pick their favorite (supported)
profiler.

An additional benefit for puffin users is that dependencies of egui are
included in the instrumentation output too (mainly wgpu which uses the
profiling crate), so more details might be available when profiling.

A breaking change is that instead of using the `puffin` feature on egui,
users that want to profile the crate with puffin instead have to enable
the `profile-with-puffin` feature on the profiling crate. Similarly they
could instead choose to use `profile-with-tracy` etc.

I tried to add a 'tracy' feature to egui_demo_app in order to showcase ,
however the /scripts/check.sh currently breaks on mutually exclusive
features (which this introduces), so I decided against including it for
the initial PR. I'm happy to iterate more on this if there is interest
in taking this PR though.

Screenshot showing the additional info for wgpu now available when using
puffin

![image](https://github.com/user-attachments/assets/49fc0e7e-8f88-40cb-a69e-74ca2e3f90f3)
2024-12-16 09:15:54 +01:00
lucasmerlin 6c1d695fc6
Add screenshot support for eframe web (#5438)
This implements web support for taking screenshots in an eframe app (and
adds a nice demo).
It also updates the native screenshot implementation to work with the
wgpu gl backend.

The wgpu implementation is quite different than the native one because
we can't block to wait for the screenshot result, so instead I use a
channel to pass the result to a future frame asynchronously.

* Closes <https://github.com/emilk/egui/issues/5425>
* [x] I have followed the instructions in the PR template


https://github.com/user-attachments/assets/67cad40b-0384-431d-96a3-075cc3cb98fb
2024-12-12 19:17:42 +01:00
Emil Ernerfeldt 53a926a428
Update MSRV to 1.80 (#5457)
Because some dependencies now require it, see:
* https://github.com/emilk/egui/pull/5456
2024-12-10 16:09:03 +01:00
Emil Ernerfeldt 5384600fa2 cargo fmt 2024-12-09 12:11:27 +01:00
EriKWDev 39d6b3367b
Support wgpu-tracing with same mechanism as wgpu examples (#5450)
Gets the WGPU_TRACE env variable and gives it as an optional argument
to request_device. Same mechanism as the wgpu-examples:


11b51693d3/examples/src/framework.rs (L316)
2024-12-09 11:58:33 +01:00
Emil Ernerfeldt 328422dc62
Update MSRV to Rust 1.79 (#5421)
Mostly to fix `cargo-machete` CI
2024-12-01 18:58:35 +01:00
Emil Ernerfeldt 42652e223c
Update some crates (#5337) 2024-11-01 13:07:01 +01:00
TÖRÖK Attila 67c82ed5f2
wgpu: Bump to wgpu 23.0.0 and wasm-bindgen to 0.2.95 (#5330)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-10-30 18:53:22 +01:00
Arthur Brussee 759a0b2a21
Add option to initialize on existing wgpu setup (#5319)
When mixing and matching eframe with other wgpu applications
(https://github.com/tracel-ai/burn in my case), it can be helpful to use
an existing wgpu setup to initialize eframe with. This PR changes the
WpuConfiguration (in a non-backwards compat way :/), to either take some
options how to create a wgpu setup, or an existing wgpu setup
(consisting of an instance, adapter, device and queue).

* [x] I have followed the instructions in the PR template

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-10-29 17:12:28 +01:00
Rusty-Cube 7bd6f83f18
Free textures after submitting queue instead of before with wgpu renderer (#5226)
* Closes #5224

I'm unfamiliar with wgpu, so I'd like someone to confirm, that calling
`wgpu::Texture` _after_ `wgpu::Queue::submit` is in fact the right thing
to do.

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-10-06 20:50:10 +02:00
lucasmerlin 1406e8717c
egui-wgpu: Fix docs.rs build (#5204)
This enables the rwh_06 feature in winit which is required to correctly
build egui-wgpu
- fixes #5202
2024-10-02 19:17:14 +02:00
Emil Ernerfeldt fe368bacc4 Release 0.29.1 - Bug fixes 2024-10-01 10:08:21 +02:00
Emil Ernerfeldt 59d71831fd Release 0.29.0 - Multipass, `UiBuilder`, & visual improvements 2024-09-26 15:32:02 +02:00
Andreas Reich 1603f05818
Wgpu render pass on paint callback has now static lifetime (#5149)
A very common usability issue on egui-wgpu callbacks is that `paint`
can't access any data that doesn't strictly outlive the callback
resources' data. E.g. if the callback resources have an `Arc` to some
resource manager, you can't easily pull out resources since you
statically needed to ensure that those resource references outlived the
renderpass, whose lifetime was only constrained to the callback
resources themselves.

Wgpu 22 no longer has this restriction! Its (render/compute-)passes take
care of the lifetime of any passed resource internally. The lifetime
constraint is _still_ opt-out since it protects from a common runtime
error of adding commands/passes on the parent encoder while a previously
created pass wasn't closed yet.
This is not a concern in egui-wgpu since the paint method where we have
to access the render pass doesn't even have access to the encoder!
2024-09-23 11:48:09 +02:00
valadaptive bb9e874c83
Update sampler along with texture on wgpu backend (#5122)
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to test and add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

* Closes #5121
* [x] I have followed the instructions in the PR template

This unifies the code paths in `update_texture` somewhat, so that the
texture sampler and bind group are always replaced.

Not sure whether removing and reinserting the texture from and into the
`textures` map, or creating a new bind group, has much of a performance
impact. An alternative, as described in #5121, would be to split the
functionality for updating a texture's data from updating its options,
so that we don't have to unconditionally update the bind group (or do
something like store the options to check if they're changed).
2024-09-19 09:16:42 +02:00
9SMTM6 08f5eb30a4
Add opt-out `fragile-send-sync-non-atomic-wasm` feature for wgpu (#5098)
Note this will break people depending on eframe or egui-wgpu with
--no-default-features.
I don't know what to do about that to be honest.

* Closes #4914 
* [x] I have followed the instructions in the PR template

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-09-13 13:00:18 +02:00
Tiaan Louw 1ccd056d19
Remove reference to egui::Color32. (#5011)
As most of the code refers to types in epaint, it makes sense to use the
Color32 alias from epaint as well.

<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to test and add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

- [x] I have followed the instructions in the PR template
2024-09-09 14:34:13 +02:00
Guillaume Gomez da04339f5e
Enable rustdoc `generate-link-to-definition` feature on docs.rs (#5030)
You can see this feature in action
[here](https://docs.rs/sysinfo/latest/src/sysinfo/common/system.rs.html#46)
or on any of dtolnay's crates and many others. I found myself going
through your project code recently on docs.rs and I was a bit sad I
couldn't have this feature enabled. This should fix it at next release.
:)
2024-08-30 11:22:29 +02:00
Nicolas 343c3d16c3
Remove wildcard imports (#5018)
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to test and add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

I removed (I hope so) all wildcard imports I found.

For me on my pc this improved the build time:
- for egui -5s
- for eframe -12s

* [x] I have followed the instructions in the PR template
2024-08-28 12:18:42 +02:00