diff --git a/examples/describe/main.rs b/examples/describe/main.rs index 72e40493a6..d035df44aa 100644 --- a/examples/describe/main.rs +++ b/examples/describe/main.rs @@ -1,9 +1,11 @@ /// This example shows how to describe the adapter in use. +#[cfg(not(target_arch = "wasm32"))] fn main() { env_logger::init(); futures::executor::block_on(run()); } +#[cfg(not(target_arch = "wasm32"))] async fn run() { let adapter = wgpu::Adapter::request( &wgpu::RequestAdapterOptions { diff --git a/src/lib.rs b/src/lib.rs index 1938735214..e95436d073 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,6 +7,7 @@ mod macros; use std::{future::Future, ops::Range, thread}; +#[cfg(not(target_arch = "wasm32"))] pub use wgc::instance::{AdapterInfo, DeviceType}; pub use wgt::{ read_spirv, AddressMode, Backend, BackendBit, BlendDescriptor, BlendFactor, BlendOperation, @@ -19,12 +20,6 @@ pub use wgt::{ TextureFormat, TextureUsage, TextureViewDescriptor, TextureViewDimension, VertexAttributeDescriptor, VertexFormat, BIND_BUFFER_ALIGNMENT, MAX_BIND_GROUPS, }; -/* -pub use wgc::instance::{ - AdapterInfo, - DeviceType, -}; -*/ //TODO: avoid heap allocating vectors during resource creation. #[derive(Default, Debug)] @@ -584,11 +579,10 @@ impl Adapter { (device, queue) } - /* - pub fn get_info(&self) -> AdapterInfo { - wgn::adapter_get_info(self.id) - } - */ + #[cfg(not(target_arch = "wasm32"))] + pub fn get_info(&self) -> AdapterInfo { + wgn::adapter_get_info(self.id) + } } impl Device {