Minor changes for triangle example and debugging

This commit is contained in:
Pierre Krieger 2016-02-19 08:39:03 +01:00
parent d8519e3ccf
commit a560ec4f76
3 changed files with 14 additions and 6 deletions

View File

@ -78,6 +78,14 @@ impl Device {
layer.as_ptr()
}).collect::<Vec<_>>();
let extensions = ["VK_KHR_swapchain"].iter().map(|&ext| {
// FIXME: check whether each extension is supported
CString::new(ext).unwrap()
}).collect::<Vec<_>>();
let extensions = extensions.iter().map(|extension| {
extension.as_ptr()
}).collect::<Vec<_>>();
// device creation
let device = unsafe {
// each element of `queues` is a `(queue_family, priorities)`
@ -123,8 +131,8 @@ impl Device {
pQueueCreateInfos: queues.as_ptr(),
enabledLayerCount: layers.len() as u32,
ppEnabledLayerNames: layers.as_ptr(),
enabledExtensionCount: 0, // TODO:
ppEnabledExtensionNames: ptr::null(), // TODO:
enabledExtensionCount: extensions.len() as u32,
ppEnabledExtensionNames: extensions.as_ptr(),
pEnabledFeatures: &features,
};

View File

@ -118,8 +118,8 @@ macro_rules! renderpass {
samples: 1, // FIXME:
load: renderpass!(__load_op__ $($attrs),*),
store: $crate::framebuffer::StoreOp::Store, // FIXME:
initial_layout: $crate::image::Layout::ColorAttachmentOptimal, // FIXME:
final_layout: $crate::image::Layout::ColorAttachmentOptimal, // FIXME:
initial_layout: $crate::image::Layout::PresentSrc, // FIXME:
final_layout: $crate::image::Layout::PresentSrc, // FIXME:
}
)*
]
@ -228,7 +228,7 @@ impl<L> RenderPass<L> where L: RenderPassLayout {
let color_attachment_references = layout.attachments().iter().map(|attachment| {
vk::AttachmentReference {
attachment: 0,
layout: vk::IMAGE_LAYOUT_GENERAL,
layout: vk::IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
}
}).collect::<Vec<_>>();

View File

@ -102,7 +102,7 @@ impl Instance {
layer.as_ptr()
}).collect::<Vec<_>>();
let extensions = ["VK_KHR_surface", "VK_KHR_win32_surface", "VK_EXT_debug_report"].iter().map(|&ext| {
let extensions = ["VK_KHR_surface", "VK_KHR_swapchain", "VK_KHR_win32_surface", "VK_EXT_debug_report"].iter().map(|&ext| {
// FIXME: check whether each extension is supported
CString::new(ext).unwrap()
}).collect::<Vec<_>>();