mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Only expose adapter info on native
This commit is contained in:
committed by
Josh Groves
parent
a6473b52b9
commit
b34c0af749
@@ -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 {
|
||||
|
||||
16
src/lib.rs
16
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 {
|
||||
|
||||
Reference in New Issue
Block a user