Skip to content

Commit

Permalink
Fix validation warnings on macOS
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kanerogers committed May 18, 2024
1 parent 33f50fb commit d7a4f8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion crates/yakui-vulkan/examples/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
5 changes: 4 additions & 1 deletion crates/yakui-vulkan/src/descriptors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);

Expand All @@ -41,6 +43,7 @@ impl Descriptors {
descriptor_count: 1000,
..Default::default()
}])
.flags(vk::DescriptorSetLayoutCreateFlags::UPDATE_AFTER_BIND_POOL)
.push_next(&mut binding_flags),
None,
)
Expand Down

0 comments on commit d7a4f8d

Please sign in to comment.