texture gets its own command buffer and fence
This commit is contained in:
parent
ab422a283d
commit
81bf301666
2 changed files with 11 additions and 3 deletions
|
@ -26,12 +26,14 @@ pub(super) struct VulkanData {
|
|||
pub(super) pool: vk::CommandPool,
|
||||
pub(super) draw_command_buffer: vk::CommandBuffer,
|
||||
pub(super) setup_command_buffer: vk::CommandBuffer,
|
||||
pub(super) texture_copy_command_buffer: vk::CommandBuffer,
|
||||
|
||||
pub(super) present_complete_semaphore: vk::Semaphore,
|
||||
pub(super) rendering_complete_semaphore: vk::Semaphore,
|
||||
|
||||
pub(super) draw_commands_reuse_fence: vk::Fence,
|
||||
pub(super) setup_commands_reuse_fence: vk::Fence,
|
||||
pub(super) texture_copy_commands_reuse_fence: vk::Fence,
|
||||
|
||||
pub(super) descriptor_sets: Vec<vk::DescriptorSet>,
|
||||
pub(super) descriptor_pool: vk::DescriptorPool,
|
||||
|
@ -108,7 +110,7 @@ impl VulkanData {
|
|||
let pool = device.create_command_pool(&pool_create_info, None).unwrap();
|
||||
|
||||
let command_buffer_allocate_info = vk::CommandBufferAllocateInfo::builder()
|
||||
.command_buffer_count(2)
|
||||
.command_buffer_count(3)
|
||||
.command_pool(pool)
|
||||
.level(vk::CommandBufferLevel::PRIMARY)
|
||||
.build();
|
||||
|
@ -118,6 +120,7 @@ impl VulkanData {
|
|||
.unwrap();
|
||||
let setup_command_buffer = command_buffers[0];
|
||||
let draw_command_buffer = command_buffers[1];
|
||||
let texture_copy_command_buffer = command_buffers[2];
|
||||
|
||||
let device_memory_properties = manager
|
||||
.instance
|
||||
|
@ -133,6 +136,9 @@ impl VulkanData {
|
|||
let setup_commands_reuse_fence = device
|
||||
.create_fence(&fence_create_info, None)
|
||||
.expect("Create fence failed.");
|
||||
let texture_copy_commands_reuse_fence = device
|
||||
.create_fence(&fence_create_info, None)
|
||||
.expect("Create fence failed.");
|
||||
|
||||
let semaphore_create_info = vk::SemaphoreCreateInfo::default();
|
||||
|
||||
|
@ -199,10 +205,12 @@ impl VulkanData {
|
|||
pool,
|
||||
draw_command_buffer,
|
||||
setup_command_buffer,
|
||||
texture_copy_command_buffer,
|
||||
present_complete_semaphore,
|
||||
rendering_complete_semaphore,
|
||||
draw_commands_reuse_fence,
|
||||
setup_commands_reuse_fence,
|
||||
texture_copy_commands_reuse_fence,
|
||||
descriptor_sets,
|
||||
desc_set_layouts,
|
||||
descriptor_pool,
|
||||
|
|
|
@ -487,8 +487,8 @@ impl VulkanWindowInner {
|
|||
|
||||
record_submit_commandbuffer(
|
||||
&self.vulkan_data.device,
|
||||
self.vulkan_data.setup_command_buffer,
|
||||
self.vulkan_data.setup_commands_reuse_fence,
|
||||
self.vulkan_data.texture_copy_command_buffer,
|
||||
self.vulkan_data.texture_copy_commands_reuse_fence,
|
||||
self.vulkan_data.present_queue,
|
||||
&[],
|
||||
&[],
|
||||
|
|
Loading…
Add table
Reference in a new issue