Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update wgpu to 0.19 #3824

Merged
merged 37 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f8c3154
update to wgpu bleeding edge
Wumpf Jan 11, 2024
ba99680
add wgpu-with-webgl-fallback feature
Wumpf Jan 11, 2024
828ddec
web fixup
Wumpf Jan 11, 2024
5297bc2
Use wgpu from main and make setting the window safe (and provide an u…
Wumpf Jan 14, 2024
1871ffe
Remove `wgpu-with-webgl-fallback` again
Wumpf Jan 14, 2024
5a5022f
Remove exe
emilk Jan 15, 2024
5d754c8
Clean up Cargo.toml
emilk Jan 15, 2024
404a95a
In eframe, document the need to turn on webgl/webgpu features of wgpu
emilk Jan 16, 2024
9e6b6ae
Improve docs of egui-wgpu
emilk Jan 16, 2024
84f351d
Fix doc-tests
emilk Jan 16, 2024
ce84ec1
update wgpu and wasm-bindgen
emilk Jan 18, 2024
cd2f6e0
Update to raw-window-handle 0.6 (except for glow, stuck at 0.5)
emilk Jan 18, 2024
4c7540f
Make winit a workspace dependency
emilk Jan 18, 2024
ebba9f5
Don't use deprecated methods of new raw-window-handle
emilk Jan 18, 2024
9c212c3
Fix web build
emilk Jan 18, 2024
ccb9dc8
rwh fixes
emilk Jan 18, 2024
8e16563
Nicer output from check.sh
emilk Jan 18, 2024
b18d4b2
linux build fix
emilk Jan 18, 2024
3840a84
cleanup
emilk Jan 18, 2024
c8c839f
build_demo_web.sh: quiet building
emilk Jan 18, 2024
d6bdadb
remove ehco in build_demo_web.sh
emilk Jan 18, 2024
6b0c20b
Web logger: Mute debug log-spam from wgpu crates
emilk Jan 18, 2024
90d7524
List selected and available adapters in the egui_demo_app backend panel
emilk Jan 18, 2024
08fcca4
Remove "drag-to-move-window" demo from egui_demo_app
emilk Jan 18, 2024
e996df6
fix typo
emilk Jan 18, 2024
7e66aa5
We cannot list available adapters on web
emilk Jan 18, 2024
9b21cde
Warn about the 0.0.0.0 footgun
emilk Jan 18, 2024
5ae0072
typo
emilk Jan 18, 2024
70bec10
check `window.isSecureContext` and print info when not secure
emilk Jan 19, 2024
676cbb9
Explain how to opt-out of WebGPU
emilk Jan 19, 2024
2421a62
Use `get_default_config` on web
emilk Jan 19, 2024
1b110e9
typo
emilk Jan 19, 2024
5fa9794
Use `get_default_config` on native
emilk Jan 19, 2024
5ce6c66
Better docs on how to pick WebGL and/or WebGPU
emilk Jan 19, 2024
a329f83
fix web build
emilk Jan 19, 2024
f71ba2b
Add 'WebGPU' to list of known words in clippy.toml
emilk Jan 19, 2024
d97c8df
Clippy fix
emilk Jan 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion crates/egui-wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ pub struct RenderState {
pub adapter: Arc<wgpu::Adapter>,

/// All the available adapters.
///
/// This is not availabler on web.
emilk marked this conversation as resolved.
Show resolved Hide resolved
/// On web, we always select WebGPU is available, then fall back to WebGL if not.
#[cfg(not(target_arch = "wasm32"))]
pub available_adapters: Arc<[wgpu::Adapter]>,

/// Wgpu device used for rendering, created from the adapter.
Expand Down Expand Up @@ -86,7 +90,9 @@ impl RenderState {
) -> Result<Self, WgpuError> {
crate::profile_scope!("RenderState::create"); // async yield give bad names using `profile_function`

let available_adapters: Vec<_> = instance.enumerate_adapters(wgpu::Backends::all());
// This is always an empty list on web.
#[cfg(not(target_arch = "wasm32"))]
let available_adapters = instance.enumerate_adapters(wgpu::Backends::all());

let adapter = {
crate::profile_scope!("request_adapter");
Expand Down Expand Up @@ -118,6 +124,13 @@ impl RenderState {
})?
};

#[cfg(target_arch = "wasm32")]
log::debug!(
"Picked wgpu adapter: {}",
adapter_info_summary(&adapter.get_info())
);

#[cfg(not(target_arch = "wasm32"))]
if available_adapters.len() == 1 {
log::debug!(
"Picked the only available wgpu adapter: {}",
Expand Down Expand Up @@ -152,6 +165,7 @@ impl RenderState {

Ok(Self {
adapter: Arc::new(adapter),
#[cfg(not(target_arch = "wasm32"))]
available_adapters: available_adapters.into(),
device: Arc::new(device),
queue: Arc::new(queue),
Expand All @@ -161,6 +175,7 @@ impl RenderState {
}
}

#[cfg(not(target_arch = "wasm32"))]
fn describe_adapters(adapters: &[wgpu::Adapter]) -> String {
if adapters.is_empty() {
"(none)".to_owned()
Expand Down
1 change: 1 addition & 0 deletions crates/egui_demo_app/src/backend_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ fn integration_ui(ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
wgpu_adapter_ui(ui, &render_state.adapter);
ui.end_row();

#[cfg(not(target_arch = "wasm32"))]
if 1 < render_state.available_adapters.len() {
ui.label("Others:");
ui.vertical(|ui| {
Expand Down
Loading