Commit graph

28 commits

Author SHA1 Message Date
Emil Ernerfeldt
923b67ef9c
Update to winit 0.27.2, glutin 0.29.0, glium 0.32 (#1914) 2022-08-14 16:23:46 +02:00
Emil Ernerfeldt
7c25a9238e Remove get_ prefix from functions to better follow Rust API Guidelines 2022-08-08 12:21:53 +02:00
Emil Ernerfeldt
9e41fa021a eframe: rename render_state to wgpu_render_state for added clarity 2022-08-08 12:15:31 +02:00
Dylan Ancel
1af446b9e8
Make egui_wgpu::RenderPass Send and Sync (#1883)
* Make RenderPass Send and Sync

* Add change to CHANGELOG

* Make CHANGELOG formatting match egui

* Add test
2022-08-03 09:26:16 +02:00
Emil Ernerfeldt
10788ccc92
More newlines for improved readability (#1880)
* Add blank lines above all `fn`, `impl`, `struct`, etc
* Even newlines between docstringed struct and enum fields
* Improve some documentation
2022-08-02 17:26:33 +02:00
Emil Ernerfeldt
09d636b089 egui-wgpu: correctly handle viewport rectangle for callbacks
This is important for when a callback shape is inside a ScrollArea.
2022-07-29 00:06:08 +02:00
Connor Fitzgerald
0571bf67e2
Reset the scissor rect after rendering onto a renderpass (#1858) 2022-07-27 01:09:19 +02:00
Matt Campbell
7a46a23db5
Update MSRV to Rust 1.61.0 (#1846) 2022-07-26 16:50:53 +02:00
Emil Ernerfeldt
bf15bb6e19
Use cargo cranky instead of cargo clippy (#1820)
* Use cargo cranky instead of cargo clippy

cargo cranky (https://github.com/ericseppanen/cargo-cranky)
is a new tool that passes lints specified in a Cranky.toml
to cargo clippy.

This is a possible solution to
https://github.com/rust-lang/cargo/issues/5034

* Remove `-W clippy::all` from `check.sh` (rely on `Cranky.toml` instead)
2022-07-20 12:34:19 +02:00
Emil Ernerfeldt
c062bca6ee faster builds: remove tracing-attributes feature from tracing 2022-07-04 00:11:08 +02:00
Ashley
9739009f20
Update wgpu to 0.13 (#1670)
* Update the wgsl syntax used in egui-wgpu

* Updates for the latest version of wgpu

* Update the wgpu version

* get_preffered_format -> get_supported_formats

* Just use an array access for compatible formats

* Use the naga cli to validate the egui demo app custom wgpu shader

* Run cargo check on the custom3d wgpu app

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-07-03 15:43:39 +02:00
Ashley
980a06b95e
Don't force the webgl backend in egui-wgpu (#1781) 2022-07-03 14:37:21 +02:00
mitchmindtree
7eeb292adf
Refactor common code in egui-wgpu shader entry points (#1730)
Creates `unpack_color` and `position_from_screen` functions to share
common logic between the alternative vertex shader entry points.
2022-06-11 13:52:06 +02:00
Emil Ernerfeldt
29973e5d02 Make document-features an opt-in dependency 2022-06-09 17:41:37 +02:00
Zicklag
62a00c4597
Fix bug in egui-wgpu (#1716) 2022-06-09 15:59:43 +02:00
Emil Ernerfeldt
3169ce62d5
Document feature flags using crate document-features (#1725) 2022-06-09 15:27:22 +02:00
Zicklag
218d4d4eea
WGPU PaintCallback Fixes (#1704)
* Expose egui WGPU Textures and Limit Exposed API

This allows paint callbacks to access textures allocated by egui, and
also hides the functions on the `RenderPass` that users should not need
to call.

* Fix WGPU Rendering Bug When Using Paint Callbacks

Depending on the order custom paint callbacks were rendered, some of the
egui meshes would previously not be rendered at all in a seemingly random
fashion.

* Make egui_wgpu::Renderer Functions Public Again
2022-06-02 22:45:54 +02:00
follower
e2bfdbe8b0
egui-wgpu: Ensure docs for winit feature are generated. (#1700)
per https://github.com/emilk/egui/issues/381#issuecomment-839707073
2022-05-31 12:24:12 +02:00
Ashley
abff2dcae2
Add some padding to the egui-wgpu uniform buffer for WebGL (#1671)
Required on Chromium
2022-05-28 18:41:01 +02:00
Emil Ernerfeldt
2771c8c3e5 Fix doclinks 2022-05-28 18:09:08 +02:00
Zicklag
1d9524cc59
Re-implement PaintCallbacks With Support for WGPU (#1684)
* Re-implement PaintCallbacks With Support for WGPU

This makes breaking changes to the PaintCallback system, but makes it
flexible enough to support both the WGPU and glow backends with custom
rendering.

Also adds a WGPU equivalent to the glow demo for custom painting.
2022-05-28 17:52:36 +02:00
Robert Bragg
a5076d4cc4
egui_winit/wgpu: enable Android support (#1634)
* egui-winit: don't assume window available at init

On Android in particular we can only initialize render state once we
have a native window, after a 'Resumed' lifecycle event. It's still
practical to be able to initialize an egui_winit::State early on
so this adds setters for the max_texture_side and pixels_per_point
that can be called once we have a valid Window and have initialized
a graphics context.

On Wayland, where we need to access the Display for clipboard handling
we now get the Display from the event loop instead of a window.

* egui-wgpu: lazily initialize render + surface state

Enable the renderer and surface state initialization to be deferred
until we know that any winit window we created has a valid native window
and enable the surface state to be updated in case the native window
changes.

In particular these changes help with running on Android where winit
windows will only have a valid native window associated with them
between Resumed and Paused lifecycle events, and so surface creation
(and render state initialization) needs to wait until the first
Resumed event, and the surface needs to be dropped/recreated based on
Paused/Resumed events.
2022-05-22 20:24:41 +02:00
Emil Ernerfeldt
a29154233b Add support for texture filters in WGPU backend 2022-05-22 17:40:56 +02:00
Florian Diebold
5d15e3d367
egui-wgpu: Add ability to register user textures (#1660) 2022-05-22 17:32:54 +02:00
Emil Ernerfeldt
f3e305a646 Replace TODO: with TODO(emilk): and update code guidelines 2022-05-21 16:53:25 +02:00
griffi-gh
27cca111c8
Fix wrong name in egui-wgpu CHANGELOG.md (#1645) 2022-05-21 12:49:37 +02:00
Emil Ernerfeldt
f807a290a4 Release egui-wgpu 0.18.0 2022-05-16 16:39:26 +02:00
Emil Ernerfeldt
931e716b97
Add egui_wgpu crate (#1564)
Based on https://github.com/hasenbanck/egui_wgpu_backend

`egui-wgpu` is now an official backend for `eframe` (opt-in).

Use the `wgpu` feature flag on `eframe` and the `NativeOptions::renderer` settings to pick it.

Co-authored-by: Nils Hasenbanck <nils@hasenbanck.de>
Co-authored-by: Sven Niederberger <niederberger@embotech.com>
Co-authored-by: Sven Niederberger <73159570+s-nie@users.noreply.github.com>
2022-05-12 09:02:28 +02:00