pub struct GraphicsPipeline { /* private fields */ }Expand description
Opaque representation of a pipeline object.
Also contains information about the object.
See VkPipeline.
Implementations§
Source§impl GraphicsPipeline
impl GraphicsPipeline
Sourcepub fn create<S>(
device: &Device,
info: impl Into<GraphicsPipelineInfo>,
shaders: impl IntoIterator<Item = S>,
) -> Result<Self, DriverError>
pub fn create<S>( device: &Device, info: impl Into<GraphicsPipelineInfo>, shaders: impl IntoIterator<Item = S>, ) -> Result<Self, DriverError>
Creates a new graphics pipeline on the given device.
The correct pipeline stages will be enabled based on the provided shaders. See Shader
for details on all available stages.
See VkGraphicsPipelineCreateInfo.
shaders may contain pre-built Shader values or any inputs that can be converted into
them. Invalid shader data is returned as DriverError::InvalidData through the Result
instead of panicking.
§Examples
Basic usage:
// shader code is raw SPIR-V code as bytes
let vert = Shader::new_vertex(my_vert_code.as_slice());
let frag = Shader::new_fragment(my_frag_code.as_slice());
let info = GraphicsPipelineInfo::default();
let pipeline = GraphicsPipeline::create(&device, info, [vert, frag])?;
assert_eq!(pipeline.info().front_face, vk::FrontFace::COUNTER_CLOCKWISE);Sourcepub fn info(&self) -> GraphicsPipelineInfo
pub fn info(&self) -> GraphicsPipelineInfo
Gets the information used to create this object.
Sourcepub fn set_debug_name(&self, name: impl AsRef<str>)
pub fn set_debug_name(&self, name: impl AsRef<str>)
Sets the debugging name assigned to this pipeline.
Note: The name of the underlying Vulkan pipeline is lazily updated as submissions are recorded.
Sourcepub fn with_debug_name(self, name: impl AsRef<str>) -> Self
pub fn with_debug_name(self, name: impl AsRef<str>) -> Self
Sets the debugging name assigned to this pipeline.
Trait Implementations§
Source§impl Clone for GraphicsPipeline
impl Clone for GraphicsPipeline
Source§fn clone(&self) -> GraphicsPipeline
fn clone(&self) -> GraphicsPipeline
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more