Merge remote-tracking branch 'origin/generator' into generator
This commit is contained in:
commit
eeb17a07a1
|
@ -1,6 +1,6 @@
|
|||
environment:
|
||||
matrix:
|
||||
- TARGET: 1.21.0-x86_64-pc-windows
|
||||
- TARGET: 1.28.0-x86_64-pc-windows
|
||||
COMPILER: msvc
|
||||
install:
|
||||
- if %COMPILER%==gnu choco install -y mingw
|
||||
|
|
|
@ -13,8 +13,6 @@ documentation = "https://docs.rs/ash"
|
|||
shared_library = "0.1.5"
|
||||
lazy_static = "0.2.1"
|
||||
libc = "0.2.26"
|
||||
enumflags = "*"
|
||||
enumflags_derive = "*"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
|
|
@ -4,7 +4,7 @@ version = "0.1.0"
|
|||
authors = ["maik klein <maikklein@googlemail.com>"]
|
||||
|
||||
[dependencies]
|
||||
winit = "0.11.1"
|
||||
winit = "0.16"
|
||||
image = "0.10.4"
|
||||
ash = { path = "../ash" }
|
||||
|
||||
|
|
|
@ -46,8 +46,7 @@ pub fn record_submit_commandbuffer<D: DeviceV1_0, F: FnOnce(&D, vk::CommandBuffe
|
|||
.reset_command_buffer(
|
||||
command_buffer,
|
||||
vk::CommandBufferResetFlags::RELEASE_RESOURCES,
|
||||
)
|
||||
.expect("Reset command buffer failed.");
|
||||
).expect("Reset command buffer failed.");
|
||||
let command_buffer_begin_info = vk::CommandBufferBeginInfo {
|
||||
s_type: vk::StructureType::COMMAND_BUFFER_BEGIN_INFO,
|
||||
p_next: ptr::null(),
|
||||
|
@ -254,7 +253,7 @@ impl ExampleBase {
|
|||
ControlFlow::Continue
|
||||
}
|
||||
}
|
||||
WindowEvent::Closed => winit::ControlFlow::Break,
|
||||
WindowEvent::Destroyed => winit::ControlFlow::Break,
|
||||
_ => ControlFlow::Continue,
|
||||
},
|
||||
_ => ControlFlow::Continue,
|
||||
|
@ -267,8 +266,10 @@ impl ExampleBase {
|
|||
let events_loop = winit::EventsLoop::new();
|
||||
let window = winit::WindowBuilder::new()
|
||||
.with_title("Ash - Example")
|
||||
.with_dimensions(window_width, window_height)
|
||||
.build(&events_loop)
|
||||
.with_dimensions(winit::dpi::LogicalSize::new(
|
||||
window_width as f64,
|
||||
window_height as f64,
|
||||
)).build(&events_loop)
|
||||
.unwrap();
|
||||
let entry = Entry::new().unwrap();
|
||||
let app_name = CString::new("VulkanTriangle").unwrap();
|
||||
|
@ -331,8 +332,8 @@ impl ExampleBase {
|
|||
.enumerate()
|
||||
.filter_map(|(index, ref info)| {
|
||||
let supports_graphic_and_surface =
|
||||
info.queue_flags.subset(vk::QueueFlags::GRAPHICS)
|
||||
&& surface_loader.get_physical_device_surface_support_khr(
|
||||
info.queue_flags.subset(vk::QueueFlags::GRAPHICS) && surface_loader
|
||||
.get_physical_device_surface_support_khr(
|
||||
*pdevice,
|
||||
index as u32,
|
||||
surface,
|
||||
|
@ -341,10 +342,8 @@ impl ExampleBase {
|
|||
true => Some((*pdevice, index)),
|
||||
_ => None,
|
||||
}
|
||||
})
|
||||
.nth(0)
|
||||
})
|
||||
.filter_map(|v| v)
|
||||
}).nth(0)
|
||||
}).filter_map(|v| v)
|
||||
.nth(0)
|
||||
.expect("Couldn't find suitable device.");
|
||||
let queue_family_index = queue_family_index as u32;
|
||||
|
@ -390,8 +389,7 @@ impl ExampleBase {
|
|||
color_space: sfmt.color_space,
|
||||
},
|
||||
_ => sfmt.clone(),
|
||||
})
|
||||
.nth(0)
|
||||
}).nth(0)
|
||||
.expect("Unable to find suitable surface format.");
|
||||
let surface_capabilities = surface_loader
|
||||
.get_physical_device_surface_capabilities_khr(pdevice, surface)
|
||||
|
@ -498,8 +496,7 @@ impl ExampleBase {
|
|||
image: image,
|
||||
};
|
||||
device.create_image_view(&create_view_info, None).unwrap()
|
||||
})
|
||||
.collect();
|
||||
}).collect();
|
||||
let device_memory_properties = instance.get_physical_device_memory_properties(pdevice);
|
||||
let depth_image_create_info = vk::ImageCreateInfo {
|
||||
s_type: vk::StructureType::IMAGE_CREATE_INFO,
|
||||
|
@ -524,12 +521,11 @@ impl ExampleBase {
|
|||
};
|
||||
let depth_image = device.create_image(&depth_image_create_info, None).unwrap();
|
||||
let depth_image_memory_req = device.get_image_memory_requirements(depth_image);
|
||||
let depth_image_memory_index =
|
||||
find_memorytype_index(
|
||||
&depth_image_memory_req,
|
||||
&device_memory_properties,
|
||||
vk::MemoryPropertyFlags::DEVICE_LOCAL,
|
||||
).expect("Unable to find suitable memory index for depth image.");
|
||||
let depth_image_memory_index = find_memorytype_index(
|
||||
&depth_image_memory_req,
|
||||
&device_memory_properties,
|
||||
vk::MemoryPropertyFlags::DEVICE_LOCAL,
|
||||
).expect("Unable to find suitable memory index for depth image.");
|
||||
|
||||
let depth_image_allocate_info = vk::MemoryAllocateInfo {
|
||||
s_type: vk::StructureType::MEMORY_ALLOCATE_INFO,
|
||||
|
|
Loading…
Reference in a new issue