pub struct Kernel { /* private fields */ }Expand description
A compiled GPU compute kernel, ready for repeated dispatch.
Created via [Device::compile]. Holds all GPU objects needed to
dispatch a shader — SPIR-V, Vulkan pipeline, layouts — so that
repeated dispatches skip compilation entirely.
§Example
ⓘ
let kernel = gpu.compile(SHADER_SRC)?;
for batch in &batches {
gpu.run(&kernel, &[&batch.input, &batch.output], batch.len)?;
}Implementations§
Source§impl Kernel
impl Kernel
Sourcepub const fn binding_count(&self) -> usize
pub const fn binding_count(&self) -> usize
Number of buffer bindings the shader expects.
Sourcepub fn entry_point(&self) -> &str
pub fn entry_point(&self) -> &str
The entry point name compiled into this kernel.
Sourcepub const fn workgroup_size(&self) -> [u32; 3]
pub const fn workgroup_size(&self) -> [u32; 3]
Workgroup size [x, y, z] declared in the shader.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Kernel
impl RefUnwindSafe for Kernel
impl Send for Kernel
impl Sync for Kernel
impl Unpin for Kernel
impl UnsafeUnpin for Kernel
impl UnwindSafe for 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