Refactor VK layer handling and add logging improvements
Refactored VK layer handling by changing return type of `use_layers` to `Vec<CString>`, adjusting subsequent usage of layers. Implemented `Display` for `VkPhysicalDevice` for better logging. Enhanced application initialization with detailed window attributes. Transitioned to using `log::info` for consistent logging.
This commit is contained in:
parent
f52832e0e5
commit
4048937a6c
5 changed files with 43 additions and 19 deletions
|
@ -3,7 +3,7 @@ use std::ffi::CString;
|
|||
pub fn use_layers(
|
||||
entry: &ash::Entry,
|
||||
layers_to_select: Vec<&str>,
|
||||
) -> Vec<*const std::ffi::c_char> {
|
||||
) -> Vec<CString> {
|
||||
let layers_available = get_layers_available(entry);
|
||||
|
||||
log_layers_available(&layers_available);
|
||||
|
@ -14,8 +14,8 @@ pub fn use_layers(
|
|||
|
||||
selected_layers
|
||||
.iter()
|
||||
.map(|sl| CString::new(sl.clone().as_bytes()).unwrap().as_ptr())
|
||||
.collect()
|
||||
.map(|sl| CString::new(sl.clone().as_bytes()).unwrap())
|
||||
.collect::<Vec<_>>()
|
||||
}
|
||||
|
||||
fn get_layers_available(entry: &ash::Entry) -> Vec<ash::vk::LayerProperties> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue