Debian Codegraph @

third_party/rust/metal/examples/caps/main.rs

raw
1 // Copyright 2017 GFX developers
2 //
3 // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
4 // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5 // http://opensource.org/licenses/MIT>, at your option. This file may not be
6 // copied, modified, or distributed except according to those terms.
7
8 use metal::*;
9
10 fn main() {
11 let device = Device::system_default().expect("no device found");
12
13 #[cfg(feature = "private")]
14 {
15 println!("Vendor: {:?}", unsafe { device.vendor() });
16 println!("Family: {:?}", unsafe { device.family_name() });
17 }
18 println!(
19 "Max threads per threadgroup: {:?}",
20 device.max_threads_per_threadgroup()
21 );
22 #[cfg(target_os = "macos")]
23 {
24 println!("Integrated GPU: {:?}", device.is_low_power());
25 println!("Headless: {:?}", device.is_headless());
26 println!("D24S8: {:?}", device.d24_s8_supported());
27 }
28 println!("maxBufferLength: {} Mb", device.max_buffer_length() >> 20);
29 println!(
30 "Indirect argument buffer: {:?}",
31 device.argument_buffers_support()
32 );
33 }