Only expose adapter info on native

This commit is contained in:
Joshua Groves
2020-04-06 00:41:38 -02:30
committed by Josh Groves
parent a6473b52b9
commit b34c0af749
2 changed files with 7 additions and 11 deletions

View File

@@ -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 {

View File

@@ -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 {