pub struct ComputeContext { /* private fields */ }Expand description
Main context for compute operations
This is the primary entry point for the Kronos Compute API. It manages the Vulkan instance, device, and queue, and provides methods to create buffers, pipelines, and execute commands.
Implementations§
Source§impl ComputeContext
impl ComputeContext
Sourcepub fn device_properties(&self) -> VkPhysicalDeviceProperties
pub fn device_properties(&self) -> VkPhysicalDeviceProperties
Get device properties
Source§impl ComputeContext
impl ComputeContext
Sourcepub fn load_shader<P: AsRef<Path>>(&self, path: P) -> Result<Shader>
pub fn load_shader<P: AsRef<Path>>(&self, path: P) -> Result<Shader>
Load a shader from SPIR-V file
Sourcepub fn create_shader_from_spirv(&self, spirv: &[u8]) -> Result<Shader>
pub fn create_shader_from_spirv(&self, spirv: &[u8]) -> Result<Shader>
Create a shader from SPIR-V bytes
Sourcepub fn create_pipeline(&self, shader: &Shader) -> Result<Pipeline>
pub fn create_pipeline(&self, shader: &Shader) -> Result<Pipeline>
Create a compute pipeline with default configuration
Sourcepub fn create_pipeline_with_config(
&self,
shader: &Shader,
config: PipelineConfig,
) -> Result<Pipeline>
pub fn create_pipeline_with_config( &self, shader: &Shader, config: PipelineConfig, ) -> Result<Pipeline>
Create a compute pipeline with custom configuration
Source§impl ComputeContext
impl ComputeContext
Sourcepub fn dispatch(&self, pipeline: &Pipeline) -> CommandBuilder
pub fn dispatch(&self, pipeline: &Pipeline) -> CommandBuilder
Start building a compute dispatch
Source§impl ComputeContext
impl ComputeContext
Sourcepub fn create_fence(&self, signaled: bool) -> Result<Fence>
pub fn create_fence(&self, signaled: bool) -> Result<Fence>
Create a new fence
Sourcepub fn create_semaphore(&self) -> Result<Semaphore>
pub fn create_semaphore(&self) -> Result<Semaphore>
Create a new semaphore
Source§impl ComputeContext
Entry point for the unified API
impl ComputeContext
Entry point for the unified API
Example:
use kronos_compute::api;
let ctx = api::ComputeContext::builder()
.app_name("My Compute App")
.enable_validation()
.build()?;Trait Implementations§
Source§impl Clone for ComputeContext
impl Clone for ComputeContext
Source§fn clone(&self) -> ComputeContext
fn clone(&self) -> ComputeContext
Returns a duplicate 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 moreSource§impl Drop for ComputeContext
impl Drop for ComputeContext
impl Send for ComputeContext
impl Sync for ComputeContext
Auto Trait Implementations§
impl Freeze for ComputeContext
impl RefUnwindSafe for ComputeContext
impl Unpin for ComputeContext
impl UnwindSafe for ComputeContext
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