Skip to content

Commit

Permalink
fix web build
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Jan 8, 2025
1 parent ce9f9ef commit 45ae9aa
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/egui-wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,14 @@ pub fn adapter_info_summary(info: &wgpu::AdapterInfo) -> String {
summary += &format!(", driver_info: {driver_info:?}");
}
if *vendor != 0 {
summary += &format!(", vendor: {} (0x{vendor:04X})", parse_vendor_id(*vendor));
#[cfg(not(target_arch = "wasm32"))]
{
summary += &format!(", vendor: {} (0x{vendor:04X})", parse_vendor_id(*vendor));
}
#[cfg(target_arch = "wasm32")]
{
summary += &format!(", vendor: 0x{vendor:04X}");
}
}
if *device != 0 {
summary += &format!(", device: 0x{device:02X}");
Expand All @@ -434,6 +441,7 @@ pub fn adapter_info_summary(info: &wgpu::AdapterInfo) -> String {
}

/// Tries to parse the adapter's vendor ID to a human-readable string.
#[cfg(not(target_arch = "wasm32"))]
pub fn parse_vendor_id(vendor_id: u32) -> &'static str {
match vendor_id {
wgpu::hal::auxil::db::amd::VENDOR => "AMD",
Expand Down

0 comments on commit 45ae9aa

Please sign in to comment.