Add DescriptorWrite for InputAttachments

This commit is contained in:
hodasemi 2023-01-22 09:12:56 +01:00
parent fd351960a7
commit a6004c0824

View file

@ -122,6 +122,27 @@ impl DescriptorWrite {
}
}
pub fn input_attachments(binding: u32, images: &[&Arc<Image>]) -> Self {
DescriptorWrite {
binding,
descriptor_type: VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT,
inner: InnerWrite::Images(
images
.iter()
.map(|image| VkDescriptorImageInfo {
sampler: VkSampler::NULL_HANDLE,
imageView: image.vk_handle(),
imageLayout: image.image_layout(),
})
.collect(),
),
handles: images
.iter()
.map(|i| (*i).clone() as Arc<dyn Any + Send + Sync>)
.collect(),
}
}
pub fn acceleration_structures(
binding: u32,
acceleration_structures: &[&Arc<AccelerationStructure>],