Struct screen_13::driver::compute::ComputePipelineInfoBuilder
source · pub struct ComputePipelineInfoBuilder { /* private fields */ }Expand description
Builder for ComputePipelineInfo.
Implementations
sourceimpl ComputePipelineInfoBuilder
impl ComputePipelineInfoBuilder
sourcepub fn bindless_descriptor_count(self, value: u32) -> Self
pub fn bindless_descriptor_count(self, value: u32) -> Self
The number of descriptors to allocate for a given binding when using bindless (unbounded) syntax.
The default is 8192.
Examples
Basic usage (GLSL):
#version 460 core
#extension GL_EXT_nonuniform_qualifier : require
layout(set = 0, binding = 0, rgba8) writeonly uniform image2D my_binding[];
void main()
{
// my_binding will have space for 8,192 images by default
}sourcepub fn entry_name(self, value: String) -> Self
pub fn entry_name(self, value: String) -> Self
The GLSL or HLSL shader entry point name, or main by default.
sourcepub fn specialization_info(self, value: SpecializationInfo) -> Self
pub fn specialization_info(self, value: SpecializationInfo) -> Self
Data about Vulkan specialization constants.
Examples
Basic usage (GLSL):
#version 460 core
// Defaults to 6 if not set using ComputePipelineInfo.specialization_info!
layout(constant_id = 0) const uint MY_COUNT = 6;
layout(set = 0, binding = 0) uniform sampler2D my_samplers[MY_COUNT];
void main()
{
// Code uses MY_COUNT number of my_samplers here
}// We instead specify 42 for MY_COUNT:
let info = ComputePipelineInfo::new(my_shader_code.as_slice())
.specialization_info(SpecializationInfo::new(
[vk::SpecializationMapEntry {
constant_id: 0,
offset: 0,
size: 4,
}],
42u32.to_ne_bytes()
));
let pipeline = ComputePipeline::create(&device, info)?;sourcepub fn spirv(self, value: Vec<u8>) -> Self
pub fn spirv(self, value: Vec<u8>) -> Self
Shader code.
Although SPIR-V code is specified as u32 values, this field uses u8 in order to make
loading from file simpler. You should always have a SPIR-V code length which is a multiple
of four bytes, or a panic will happen during ComputePipeline::create.
sourceimpl ComputePipelineInfoBuilder
impl ComputePipelineInfoBuilder
sourcepub fn build(self) -> ComputePipelineInfo
pub fn build(self) -> ComputePipelineInfo
Builds a new ComputePipelineInfo.
Trait Implementations
sourceimpl Default for ComputePipelineInfoBuilder
impl Default for ComputePipelineInfoBuilder
sourceimpl From<ComputePipelineInfoBuilder> for ComputePipelineInfo
impl From<ComputePipelineInfoBuilder> for ComputePipelineInfo
sourcefn from(info: ComputePipelineInfoBuilder) -> Self
fn from(info: ComputePipelineInfoBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for ComputePipelineInfoBuilder
impl Send for ComputePipelineInfoBuilder
impl Sync for ComputePipelineInfoBuilder
impl Unpin for ComputePipelineInfoBuilder
impl UnwindSafe for ComputePipelineInfoBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more