pub struct ComputeShaderDesc {
pub entry_point: String,
pub workgroup_size: [u32; 3],
pub source: String,
}Expand description
Descriptor for a WGSL compute shader.
Fields§
§entry_point: StringName of the entry-point function (e.g. "main").
workgroup_size: [u32; 3]Workgroup size [x, y, z].
source: StringFull WGSL source string.
Implementations§
Source§impl ComputeShaderDesc
impl ComputeShaderDesc
Sourcepub fn new(
entry_point: impl Into<String>,
workgroup_size: [u32; 3],
source: impl Into<String>,
) -> Self
pub fn new( entry_point: impl Into<String>, workgroup_size: [u32; 3], source: impl Into<String>, ) -> Self
Create a new compute shader descriptor.
Sourcepub fn threads_per_workgroup(&self) -> u32
pub fn threads_per_workgroup(&self) -> u32
Number of threads per workgroup.
Sourcepub fn binding_count(&self) -> usize
pub fn binding_count(&self) -> usize
Count the number of binding annotations in the shader source.
Trait Implementations§
Source§impl Clone for ComputeShaderDesc
impl Clone for ComputeShaderDesc
Source§fn clone(&self) -> ComputeShaderDesc
fn clone(&self) -> ComputeShaderDesc
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ComputeShaderDesc
impl RefUnwindSafe for ComputeShaderDesc
impl Send for ComputeShaderDesc
impl Sync for ComputeShaderDesc
impl Unpin for ComputeShaderDesc
impl UnsafeUnpin for ComputeShaderDesc
impl UnwindSafe for ComputeShaderDesc
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more