mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 23:11:01 +01:00
Remove Hello Example
This commit is contained in:
1 parent
c73bd2fa60
commit
43b6637754
2 files changed
-56
No files matched your search
@@ -1,20 +0,0 @@
|
||||
# hello
|
||||
|
||||
This example prints output describing the adapter in use.
|
||||
|
||||
## To Run
|
||||
|
||||
```
|
||||
cargo run --bin wgpu-examples hello
|
||||
```
|
||||
|
||||
## Example output
|
||||
|
||||
```
|
||||
# You might see different output as it depends on your graphics card and drivers
|
||||
Available adapters:
|
||||
AdapterInfo { name: "AMD RADV VEGA10", vendor: 4098, device: 26751, device_type: DiscreteGpu, backend: Vulkan }
|
||||
AdapterInfo { name: "llvmpipe (LLVM 12.0.0, 256 bits)", vendor: 65541, device: 0, device_type: Cpu, backend: Vulkan }
|
||||
AdapterInfo { name: "Radeon RX Vega (VEGA10, DRM 3.41.0, 5.13.0-52-generic, LLVM 12.0.0)", vendor: 4098, device: 0, device_type: Other, backend: Gl }
|
||||
Selected adapter: AdapterInfo { name: "AMD RADV VEGA10", vendor: 4098, device: 26751, device_type: DiscreteGpu, backend: Vulkan }
|
||||
```
|
||||
@@ -1,36 +0,0 @@
|
||||
/// This example shows how to describe the adapter in use.
|
||||
async fn run() {
|
||||
let adapter = {
|
||||
let instance = wgpu::Instance::default();
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
{
|
||||
log::info!("Available adapters:");
|
||||
for a in instance.enumerate_adapters(wgpu::Backends::all()) {
|
||||
log::info!(" {:?}", a.get_info())
|
||||
}
|
||||
}
|
||||
instance
|
||||
.request_adapter(&wgpu::RequestAdapterOptions::default())
|
||||
.await
|
||||
.unwrap()
|
||||
};
|
||||
|
||||
log::info!("Selected adapter: {:?}", adapter.get_info())
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
{
|
||||
env_logger::builder()
|
||||
.filter(Some(module_path!()), log::LevelFilter::Info)
|
||||
.parse_default_env()
|
||||
.init();
|
||||
pollster::block_on(run());
|
||||
}
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
{
|
||||
std::panic::set_hook(Box::new(console_error_panic_hook::hook));
|
||||
console_log::init().expect("could not initialize logger");
|
||||
wasm_bindgen_futures::spawn_local(run());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user