pub unsafe fn with_unchecked_pipeline_layout<Cs>(
        device: Arc<Device>, shader: &Cs, specialization: &Cs::SpecializationConstants,
        pipeline_layout: Pl)
        -> Result<ComputePipeline<Pl>, ComputePipelineCreationError>
        where Cs::PipelineLayout: Clone,
              Cs: EntryPointAbstract,
              Pl: PipelineLayoutAbstract
    {
        let vk = device.pointers();

        let pipeline = {
            let spec_descriptors = Cs::SpecializationConstants::descriptors();
            let specialization = vk::SpecializationInfo {
                mapEntryCount: spec_descriptors.len() as u32,
                pMapEntries: spec_descriptors.as_ptr() as *const _,
                dataSize: mem::size_of_val(specialization),
                pData: specialization as *const Cs::SpecializationConstants as *const _,
            };

            let stage = vk::PipelineShaderStageCreateInfo {
                sType: vk::STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
                pNext: ptr::null(),
                flags: 0,
                stage: vk::SHADER_STAGE_COMPUTE_BIT,
                module: shader.module().internal_object(),
                pName: shader.name().as_ptr(),
                pSpecializationInfo: if specialization.dataSize == 0 {
                    ptr::null()
                } else {
                    &specialization
                },
            };

            let infos = vk::ComputePipelineCreateInfo {
                sType: vk::STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO,
                pNext: ptr::null(),
                flags: 0,
                stage: stage,
                layout: PipelineLayoutAbstract::sys(&pipeline_layout).internal_object(),
                basePipelineHandle: 0,
                basePipelineIndex: 0,
            };

            let mut output = mem::uninitialized();
            check_errors(vk.CreateComputePipelines(device.internal_object(),
                                                   0,
                                                   1,
                                                   &infos,
                                                   ptr::null(),
                                                   &mut output))?;
            output
        };

        Ok(ComputePipeline {
               inner: Inner {
                   device: device.clone(),
                   pipeline: pipeline,
               },
               pipeline_layout: pipeline_layout,
           })
    }
/// Same as `with_pipeline_layout`, but doesn't check whether the pipeline layout is a
/// superset of what the shader expects.
Same as `with_pipeline_layout`, but doesn't check whether the pipeline layout is a
superset of what the shader expects.
Same as ` with_pipeline_layout ` but doesn ' t check whether the pipeline layout is a superset of what the shader expects .
pub unsafe fn with_unchecked_pipeline_layout<Cs>(
        device: Arc<Device>, shader: &Cs, specialization: &Cs::SpecializationConstants,
        pipeline_layout: Pl)
        -> Result<ComputePipeline<Pl>, ComputePipelineCreationError>
        where Cs::PipelineLayout: Clone,
              Cs: EntryPointAbstract,
              Pl: PipelineLayoutAbstract
    {
        let vk = device.pointers();
        let pipeline = {
            let spec_descriptors = Cs::SpecializationConstants::descriptors();
            let specialization = vk::SpecializationInfo {
                mapEntryCount: spec_descriptors.len() as u32,
                pMapEntries: spec_descriptors.as_ptr() as *const _,
                dataSize: mem::size_of_val(specialization),
                pData: specialization as *const Cs::SpecializationConstants as *const _,
            };
            let stage = vk::PipelineShaderStageCreateInfo {
                sType: vk::STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
                pNext: ptr::null(),
                flags: 0,
                stage: vk::SHADER_STAGE_COMPUTE_BIT,
                module: shader.module().internal_object(),
                pName: shader.name().as_ptr(),
                pSpecializationInfo: if specialization.dataSize == 0 {
                    ptr::null()
                } else {
                    &specialization
                },
            };
            let infos = vk::ComputePipelineCreateInfo {
                sType: vk::STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO,
                pNext: ptr::null(),
                flags: 0,
                stage: stage,
                layout: PipelineLayoutAbstract::sys(&pipeline_layout).internal_object(),
                basePipelineHandle: 0,
                basePipelineIndex: 0,
            };
            let mut output = mem::uninitialized();
            check_errors(vk.CreateComputePipelines(device.internal_object(),
                                                   0,
                                                   1,
                                                   &infos,
                                                   ptr::null(),
                                                   &mut output))?;
            output
        };
        Ok(ComputePipeline {
               inner: Inner {
                   device: device.clone(),
                   pipeline: pipeline,
               },
               pipeline_layout: pipeline_layout,
           })
    }
pub unsafe fn with_unchecked_pipeline_layout < Cs > ( device : Arc < Device > , shader : & Cs , specialization : & Cs :: SpecializationConstants , pipeline_layout : Pl ) -> Result < ComputePipeline < Pl > , ComputePipelineCreationError > where Cs :: PipelineLayout : Clone , Cs : EntryPointAbstract , Pl : PipelineLayoutAbstract { let vk = device . pointers ( ) ; let pipeline = { let spec_descriptors = Cs :: SpecializationConstants :: descriptors ( ) ; let specialization = vk :: SpecializationInfo { mapEntryCount : spec_descriptors . len ( ) as u32 , pMapEntries : spec_descriptors . as_ptr ( ) as * const _ , dataSize : mem :: size_of_val ( specialization ) , pData : specialization as * const Cs :: SpecializationConstants as * const _ , } ; let stage = vk :: PipelineShaderStageCreateInfo { sType : vk :: STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO , pNext : ptr :: null ( ) , flags : 0 , stage : vk :: SHADER_STAGE_COMPUTE_BIT , module : shader . module ( ) . internal_object ( ) , pName : shader . name ( ) . as_ptr ( ) , pSpecializationInfo : if specialization . dataSize == 0 { ptr :: null ( ) } else { & specialization } , } ; let infos = vk :: ComputePipelineCreateInfo { sType : vk :: STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO , pNext : ptr :: null ( ) , flags : 0 , stage : stage , layout : PipelineLayoutAbstract :: sys ( & pipeline_layout ) . internal_object ( ) , basePipelineHandle : 0 , basePipelineIndex : 0 , } ; let mut output = mem :: uninitialized ( ) ; check_errors ( vk . CreateComputePipelines ( device . internal_object ( ) , 0 , 1 , & infos , ptr :: null ( ) , & mut output ) ) ? ; output } ; Ok ( ComputePipeline { inner : Inner { device : device . clone ( ) , pipeline : pipeline , } , pipeline_layout : pipeline_layout , } ) }
Same as `with_pipeline_layout`, but doesn't check whether the pipeline layout is a
superset of what the shader expects.
Same as ` with_pipeline_layout ` but doesn ' t check whether the pipeline layout is a superset of what the shader expects .
device
Arc<Device>
shader
&Cs
specialization
&Cs::SpecializationConstants
pipeline_layout
Pl
device
Arc<Device>
shader
&Cs
specialization
&Cs::SpecializationConstants
pipeline_layout
Pl