use same pdev
This commit is contained in:
parent
e5a75ce06a
commit
fa501247ad
1 changed files with 7 additions and 9 deletions
|
@ -36,13 +36,9 @@ impl WindowData {
|
|||
use_render_pass: true,
|
||||
disable_cache: false,
|
||||
};
|
||||
let physical_devices = unsafe { inner.instance.enumerate_physical_devices().unwrap() };
|
||||
let physical_device = physical_devices.first().unwrap();
|
||||
let vulkan = VulkanObjects::try_from((
|
||||
*physical_device,
|
||||
inner.instance.clone(),
|
||||
inner.device.clone(),
|
||||
))
|
||||
|
||||
let vulkan =
|
||||
VulkanObjects::try_from((inner.pdevice, inner.instance.clone(), inner.device.clone()))
|
||||
.unwrap();
|
||||
let filter_chain = unsafe {
|
||||
FilterChain::load_from_path(options.shader_path, vulkan, Some(&filter_chain_options))
|
||||
|
@ -69,6 +65,8 @@ impl WindowData {
|
|||
}
|
||||
|
||||
struct VulkanWindowInner {
|
||||
pdevice: vk::PhysicalDevice,
|
||||
|
||||
instance: Instance,
|
||||
device: Device,
|
||||
surface_loader: Surface,
|
||||
|
@ -686,7 +684,6 @@ impl VulkanWindowInner {
|
|||
|
||||
let shader = ash::util::read_spv(&mut std::io::Cursor::new(SHADER)).unwrap();
|
||||
let shader_info = vk::ShaderModuleCreateInfo::builder().code(&shader).build();
|
||||
println!("shader info: {:#?}", shader_info);
|
||||
|
||||
let shader_module = device
|
||||
.create_shader_module(&shader_info, None)
|
||||
|
@ -837,6 +834,7 @@ impl VulkanWindowInner {
|
|||
image_buffer_memory_req,
|
||||
image_extent,
|
||||
texture_image,
|
||||
pdevice,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue