keep layout around in pipeline
This commit is contained in:
parent
555244b221
commit
dde3093536
|
|
@ -19,6 +19,16 @@ pub struct ShaderStageDesc<'a> {
|
||||||
// specialization: Option<vk::SpecializationInfo>
|
// specialization: Option<vk::SpecializationInfo>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ShaderStageDesc<'_> {
|
||||||
|
fn as_create_info(&'_ self) -> vk::PipelineShaderStageCreateInfo<'_> {
|
||||||
|
vk::PipelineShaderStageCreateInfo::default()
|
||||||
|
.module(self.module.raw())
|
||||||
|
.flags(self.flags)
|
||||||
|
.stage(self.stage)
|
||||||
|
.name(&self.entry)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct DescriptorSetLayoutBindingDesc {
|
pub struct DescriptorSetLayoutBindingDesc {
|
||||||
pub binding: u32,
|
pub binding: u32,
|
||||||
|
|
@ -189,7 +199,7 @@ pub struct GraphicsPipelineDesc<'a> {
|
||||||
pub name: Option<Cow<'static, str>>,
|
pub name: Option<Cow<'static, str>>,
|
||||||
pub shader_stages: &'a [ShaderStageDesc<'a>],
|
pub shader_stages: &'a [ShaderStageDesc<'a>],
|
||||||
pub render_pass: Option<vk::RenderPass>,
|
pub render_pass: Option<vk::RenderPass>,
|
||||||
pub layout: &'a PipelineLayout,
|
pub layout: Arc<PipelineLayout>,
|
||||||
pub subpass: Option<u32>,
|
pub subpass: Option<u32>,
|
||||||
pub base_pipeline: Option<Arc<Pipeline>>,
|
pub base_pipeline: Option<Arc<Pipeline>>,
|
||||||
|
|
||||||
|
|
@ -544,6 +554,7 @@ impl ShaderModule {
|
||||||
pub struct Pipeline {
|
pub struct Pipeline {
|
||||||
pipeline: DeviceObject<vk::Pipeline>,
|
pipeline: DeviceObject<vk::Pipeline>,
|
||||||
bind_point: vk::PipelineBindPoint,
|
bind_point: vk::PipelineBindPoint,
|
||||||
|
layout: Arc<PipelineLayout>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: AsRef<DeviceInner>> ExternallyManagedObject<T> for vk::Pipeline {
|
impl<T: AsRef<DeviceInner>> ExternallyManagedObject<T> for vk::Pipeline {
|
||||||
|
|
@ -554,16 +565,6 @@ impl<T: AsRef<DeviceInner>> ExternallyManagedObject<T> for vk::Pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ShaderStageDesc<'_> {
|
|
||||||
fn as_create_info(&'_ self) -> vk::PipelineShaderStageCreateInfo<'_> {
|
|
||||||
vk::PipelineShaderStageCreateInfo::default()
|
|
||||||
.module(self.module.raw())
|
|
||||||
.flags(self.flags)
|
|
||||||
.stage(self.stage)
|
|
||||||
.name(&self.entry)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Pipeline {
|
impl Pipeline {
|
||||||
pub fn new_compute(device: Device, desc: ComputePipelineDesc) -> crate::Result<Self> {
|
pub fn new_compute(device: Device, desc: ComputePipelineDesc) -> crate::Result<Self> {
|
||||||
let info = &vk::ComputePipelineCreateInfo::default()
|
let info = &vk::ComputePipelineCreateInfo::default()
|
||||||
|
|
@ -593,6 +594,7 @@ impl Pipeline {
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
pipeline: DeviceObject::new_debug_named(device, pipeline, desc.name),
|
pipeline: DeviceObject::new_debug_named(device, pipeline, desc.name),
|
||||||
bind_point: vk::PipelineBindPoint::COMPUTE,
|
bind_point: vk::PipelineBindPoint::COMPUTE,
|
||||||
|
layout: desc.layout,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -761,6 +763,7 @@ impl Pipeline {
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
pipeline: DeviceObject::new_debug_named(device, pipeline, desc.name),
|
pipeline: DeviceObject::new_debug_named(device, pipeline, desc.name),
|
||||||
bind_point: vk::PipelineBindPoint::GRAPHICS,
|
bind_point: vk::PipelineBindPoint::GRAPHICS,
|
||||||
|
layout: desc.layout,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue