mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2025-02-19 18:42:31 +00:00
Minor changes for triangle example and debugging
This commit is contained in:
parent
d8519e3ccf
commit
a560ec4f76
@ -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,
|
||||
};
|
||||
|
||||
|
@ -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<_>>();
|
||||
|
||||
|
@ -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<_>>();
|
||||
|
Loading…
Reference in New Issue
Block a user