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,
|
use_render_pass: true,
|
||||||
disable_cache: false,
|
disable_cache: false,
|
||||||
};
|
};
|
||||||
let physical_devices = unsafe { inner.instance.enumerate_physical_devices().unwrap() };
|
|
||||||
let physical_device = physical_devices.first().unwrap();
|
let vulkan =
|
||||||
let vulkan = VulkanObjects::try_from((
|
VulkanObjects::try_from((inner.pdevice, inner.instance.clone(), inner.device.clone()))
|
||||||
*physical_device,
|
|
||||||
inner.instance.clone(),
|
|
||||||
inner.device.clone(),
|
|
||||||
))
|
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let filter_chain = unsafe {
|
let filter_chain = unsafe {
|
||||||
FilterChain::load_from_path(options.shader_path, vulkan, Some(&filter_chain_options))
|
FilterChain::load_from_path(options.shader_path, vulkan, Some(&filter_chain_options))
|
||||||
|
@ -69,6 +65,8 @@ impl WindowData {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct VulkanWindowInner {
|
struct VulkanWindowInner {
|
||||||
|
pdevice: vk::PhysicalDevice,
|
||||||
|
|
||||||
instance: Instance,
|
instance: Instance,
|
||||||
device: Device,
|
device: Device,
|
||||||
surface_loader: Surface,
|
surface_loader: Surface,
|
||||||
|
@ -686,7 +684,6 @@ impl VulkanWindowInner {
|
||||||
|
|
||||||
let shader = ash::util::read_spv(&mut std::io::Cursor::new(SHADER)).unwrap();
|
let shader = ash::util::read_spv(&mut std::io::Cursor::new(SHADER)).unwrap();
|
||||||
let shader_info = vk::ShaderModuleCreateInfo::builder().code(&shader).build();
|
let shader_info = vk::ShaderModuleCreateInfo::builder().code(&shader).build();
|
||||||
println!("shader info: {:#?}", shader_info);
|
|
||||||
|
|
||||||
let shader_module = device
|
let shader_module = device
|
||||||
.create_shader_module(&shader_info, None)
|
.create_shader_module(&shader_info, None)
|
||||||
|
@ -837,6 +834,7 @@ impl VulkanWindowInner {
|
||||||
image_buffer_memory_req,
|
image_buffer_memory_req,
|
||||||
image_extent,
|
image_extent,
|
||||||
texture_image,
|
texture_image,
|
||||||
|
pdevice,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue