[rs] Only expose adapter info on native

This commit is contained in:
Joshua Groves authored and Josh Groves committed 2020-04-18 01:04:28 -02:30
1 parent 654833ea56
commit 44083411d9
2 files changed
+7 -11

No files matched your search

+2
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 {
+5 -11
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 {