Change order of parameters when creating instance and device

This commit is contained in:
Pierre Krieger 2016-03-10 07:50:01 +01:00
parent 226a909848
commit bd4167d579
4 changed files with 8 additions and 8 deletions

View File

@ -30,7 +30,7 @@ fn main() {
khr_win32_surface: true,
.. vulkano::instance::InstanceExtensions::none()
};
let instance = vulkano::instance::Instance::new(Some(&app), &["VK_LAYER_LUNARG_standard_validation"], &extensions).expect("failed to create instance");
let instance = vulkano::instance::Instance::new(Some(&app), &extensions, &["VK_LAYER_LUNARG_standard_validation"]).expect("failed to create instance");
let physical = vulkano::instance::PhysicalDevice::enumerate(&instance)
.next().expect("no device available");
@ -48,7 +48,7 @@ fn main() {
};
let (device, queues) = vulkano::device::Device::new(&physical, physical.supported_features(),
[(queue, 0.5)].iter().cloned(), &["VK_LAYER_LUNARG_standard_validation"], &device_ext)
&device_ext, &["VK_LAYER_LUNARG_standard_validation"], [(queue, 0.5)].iter().cloned())
.expect("failed to create device");
let queue = queues.into_iter().next().unwrap();

View File

@ -60,8 +60,8 @@ impl Device {
/// - Panicks if one of the priorities is outside of the `[0.0 ; 1.0]` range.
///
// TODO: return Arc<Queue> and handle synchronization in the Queue
pub fn new<'a, I, L>(phys: &'a PhysicalDevice, requested_features: &Features, queue_families: I,
layers: L, extensions: &DeviceExtensions)
pub fn new<'a, I, L>(phys: &'a PhysicalDevice, requested_features: &Features,
extensions: &DeviceExtensions, layers: L, queue_families: I)
-> Result<(Arc<Device>, Vec<Arc<Queue>>), DeviceCreationError>
where I: IntoIterator<Item = (QueueFamily<'a>, f32)>,
L: IntoIterator<Item = &'a &'a str>

View File

@ -63,8 +63,8 @@ impl Instance {
/// Initializes a new instance of Vulkan.
// TODO: if no allocator is specified by the user, use Rust's allocator instead of leaving
// the choice to Vulkan
pub fn new<'a, L>(app_infos: Option<&ApplicationInfo>, layers: L, extensions: &InstanceExtensions)
-> Result<Arc<Instance>, InstanceCreationError>
pub fn new<'a, L>(app_infos: Option<&ApplicationInfo>, extensions: &InstanceExtensions,
layers: L) -> Result<Arc<Instance>, InstanceCreationError>
where L: IntoIterator<Item = &'a &'a str>
{
// Building the CStrings from the `str`s within `app_infos`.

View File

@ -10,7 +10,7 @@ macro_rules! instance {
engine_name: "vulkano tests", engine_version: 1
};
match instance::Instance::new(Some(&app), None, &instance::Extensions::none()) {
match instance::Instance::new(Some(&app), &instance::Extensions::none(), None) {
Ok(i) => i,
Err(_) => return
}
@ -39,7 +39,7 @@ macro_rules! gfx_dev_and_queue {
let extensions = DeviceExtensions::none();
let (device, queues) = match Device::new(&physical, physical.supported_features(),
[(queue, 0.5)].iter().cloned(), None, &extensions)
&extensions, None, [(queue, 0.5)].iter().cloned())
{
Ok(r) => r,
Err(_) => return