From 7346eb7bc011c95fb82502dacecb92f086389474 Mon Sep 17 00:00:00 2001 From: Kane Rogers-Wong Date: Sun, 19 May 2024 15:15:10 +1000 Subject: [PATCH] Fix validation warnings on macOS (#165) This commit sets various `UPDATE_AFTER_BIND_POOL_BIT` flags on descriptors to allow reasonable amounts of image samplers in our descriptor sets. Closes #160 --- crates/yakui-vulkan/examples/demo.rs | 3 ++- crates/yakui-vulkan/src/descriptors.rs | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/yakui-vulkan/examples/demo.rs b/crates/yakui-vulkan/examples/demo.rs index c954bc42..cadb40a3 100644 --- a/crates/yakui-vulkan/examples/demo.rs +++ b/crates/yakui-vulkan/examples/demo.rs @@ -363,7 +363,8 @@ impl VulkanTest { let mut descriptor_indexing_features = vk::PhysicalDeviceDescriptorIndexingFeatures::default() - .descriptor_binding_partially_bound(true); + .descriptor_binding_partially_bound(true) + .descriptor_binding_sampled_image_update_after_bind(true); let device_create_info = vk::DeviceCreateInfo::default() .queue_create_infos(std::slice::from_ref(&queue_info)) diff --git a/crates/yakui-vulkan/src/descriptors.rs b/crates/yakui-vulkan/src/descriptors.rs index 4c84e3c3..8059f165 100644 --- a/crates/yakui-vulkan/src/descriptors.rs +++ b/crates/yakui-vulkan/src/descriptors.rs @@ -18,6 +18,7 @@ impl Descriptors { device.create_descriptor_pool( &vk::DescriptorPoolCreateInfo::default() .max_sets(1) + .flags(vk::DescriptorPoolCreateFlags::UPDATE_AFTER_BIND) .pool_sizes(&[vk::DescriptorPoolSize { ty: vk::DescriptorType::COMBINED_IMAGE_SAMPLER, descriptor_count: 1000, @@ -27,7 +28,8 @@ impl Descriptors { } .unwrap(); - let flags = [vk::DescriptorBindingFlags::PARTIALLY_BOUND]; + let flags = [vk::DescriptorBindingFlags::PARTIALLY_BOUND + | vk::DescriptorBindingFlags::UPDATE_AFTER_BIND]; let mut binding_flags = vk::DescriptorSetLayoutBindingFlagsCreateInfo::default().binding_flags(&flags); @@ -41,6 +43,7 @@ impl Descriptors { descriptor_count: 1000, ..Default::default() }]) + .flags(vk::DescriptorSetLayoutCreateFlags::UPDATE_AFTER_BIND_POOL) .push_next(&mut binding_flags), None, )