use anyhow::Result; use vulkanalia::prelude::v1_0::*; use crate::app::AppData; pub(crate) unsafe fn create_descriptor_set_layout( device: &Device, data: &mut AppData, ) -> Result<()> { let ubo_binding = vk::DescriptorSetLayoutBinding::builder() .binding(0) .descriptor_type(vk::DescriptorType::UNIFORM_BUFFER) .descriptor_count(1) .stage_flags(vk::ShaderStageFlags::VERTEX); let sampler_binding = vk::DescriptorSetLayoutBinding::builder() .binding(1) .descriptor_type(vk::DescriptorType::COMBINED_IMAGE_SAMPLER) .descriptor_count(1) .stage_flags(vk::ShaderStageFlags::FRAGMENT); let bindings = &[ubo_binding, sampler_binding]; let info = vk::DescriptorSetLayoutCreateInfo::builder().bindings(bindings); data.descriptor_set_layout = device.create_descriptor_set_layout(&info, None)?; Ok(()) }