Struct core_compute::compute_kernel
source · pub struct compute_kernel {
pub x: u32,
pub y: u32,
pub z: u32,
pub code: String,
}Expand description
for starting your computing mission on gpu first you need to write your kernel code in wgsl (recommended) or any other shader codes which wgpu supports , and then create compute_kernel variable with that code .
x , y , z fields can be used to specify how many blocks of gpu is needed for your work
amounts of threads used = @workgroup_size (which you specify in your shader code) * x * y * z
Fields§
§x: u32sets number of GPU blocks in x direction
y: u32sets number of GPU blocks in y direction
z: u32sets number of GPU blocks in z direction
code: Stringthe default entry point is set to main function , so your kernel code in wgsl must contain main function
Trait Implementations§
source§impl Clone for compute_kernel
impl Clone for compute_kernel
source§fn clone(&self) -> compute_kernel
fn clone(&self) -> compute_kernel
Returns a copy of the value. Read more
1.0.0 · 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 compute_kernel
impl RefUnwindSafe for compute_kernel
impl Send for compute_kernel
impl Sync for compute_kernel
impl Unpin for compute_kernel
impl UnwindSafe for compute_kernel
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)