You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.5 KiB

use std::hint::black_box;
#[cfg(test)]
use vulk::vk;
use vk::*;
#[test]
fn create_instance() {
let instance: vk::Instance = vk::create_instance();
drop(instance);
}
#[test]
fn enumerate_physical_devices() {
let instance: vk::Instance = vk::create_instance();
let devices: Vec<vk::PhysicalDevice> = instance.enumerate_physical_devices();
assert!(devices.len() > 0);
drop(instance);
}
#[test]
fn physical_devices_properties() {
let instance: vk::Instance = vk::create_instance();
let devices: Vec<vk::PhysicalDevice> = instance.enumerate_physical_devices();
for device in devices {
let properties: vk::PhysicalDeviceProperties = device.get_properties();
assert!(!properties.deviceName.is_empty());
}
drop(instance);
}
#[test]
fn physical_devices_queue_family_properties() {
let instance: vk::Instance = vk::create_instance();
let devices: Vec<vk::PhysicalDevice> = instance.enumerate_physical_devices();
for device in devices {
let properties: Vec<vk::QueueFamilyProperties> = device.get_queue_family_properties();
assert!(properties.len() > 0);
}
drop(instance);
}
#[test]
fn physical_devices_features() {
let instance: vk::Instance = vk::create_instance();
let devices: Vec<vk::PhysicalDevice> = instance.enumerate_physical_devices();
for device in devices {
let features: vk::PhysicalDeviceFeatures = device.get_features();
black_box(features);
}
drop(instance);
}