moonbitstack/moonwgpu/hal does not have a README file
pub(open) trait Hal {
fn name(Self) -> String
fn limits(Self) -> Limits
fn features(Self) -> Features
fn create_buffer(Self, BufferDescriptor) -> BufferId raise HalError
fn destroy_buffer(Self, BufferId) -> Unit
fn write_buffer(Self, BufferId, Int, Bytes) -> Unit raise HalError
fn read_buffer(Self, BufferId, Int, Int) -> Bytes raise HalError
fn create_texture(Self, TextureDescriptor) -> TextureId raise HalError
fn destroy_texture(Self, TextureId) -> Unit
fn create_texture_view(Self, TextureId, TextureViewDescriptor) -> TextureViewId raise HalError
fn create_sampler(Self, SamplerDescriptor) -> SamplerId raise HalError
fn create_shader_module(Self, ShaderModuleDescriptor) -> ShaderModuleId raise HalError
fn compilation_info(Self, ShaderModuleId) -> Array[CompilationMessage]
fn create_bind_group_layout(Self, BindGroupLayoutDescriptor) -> BindGroupLayoutId raise HalError
fn create_bind_group(Self, BindGroupDescriptor) -> BindGroupId raise HalError
fn create_pipeline_layout(Self, PipelineLayoutDescriptor) -> PipelineLayoutId raise HalError
fn create_render_pipeline(Self, RenderPipelineDescriptor) -> RenderPipelineId raise HalError
fn create_compute_pipeline(Self, ComputePipelineDescriptor) -> ComputePipelineId raise HalError
fn create_query_set(Self, QuerySetDescriptor) -> QuerySetId raise HalError
fn create_external_texture(Self, ExternalTextureDescriptor) -> ExternalTextureId raise HalError
fn destroy_external_texture(Self, ExternalTextureId) -> Unit
fn submit(Self, Array[Command]) -> Unit raise HalError
fn read_texture(Self, TextureId, Origin3d, Extent3d, Int) -> Bytes raise HalError
fn write_texture(Self, TextureId, Origin3d, Extent3d, Int, Bytes) -> Unit raise HalError
}pub(open) trait Surface {
fn name(Self) -> String
fn size(Self) -> Extent3d
fn configure(Self, SurfaceConfiguration) -> Unit raise HalError
fn unconfigure(Self) -> Unit
fn capabilities(Self) -> SurfaceCapabilities
fn acquire(Self) -> SurfaceFrame raise HalError
fn present(Self, TextureId) -> Unit raise HalError
}pub suberror HalError {
Missing(what~ : String)
Unsupported(what~ : String)
Exhausted(want~ : Int, limit~ : Int)
Failed(what~ : String)
}pub struct Unbound {
name_ : String
reason_ : String
}fn create_bind_group(self : Unbound, _descriptor : BindGroupDescriptor) -> BindGroupId raise HalErrorfn create_bind_group_layout(self : Unbound, _descriptor : BindGroupLayoutDescriptor) -> BindGroupLayoutId raise HalErrorfn create_compute_pipeline(self : Unbound, _descriptor : ComputePipelineDescriptor) -> ComputePipelineId raise HalErrorfn create_external_texture(self : Unbound, _descriptor : ExternalTextureDescriptor) -> ExternalTextureId raise HalErrorfn create_pipeline_layout(self : Unbound, _descriptor : PipelineLayoutDescriptor) -> PipelineLayoutId raise HalErrorfn create_render_pipeline(self : Unbound, _descriptor : RenderPipelineDescriptor) -> RenderPipelineId raise HalErrorfn create_shader_module(self : Unbound, _descriptor : ShaderModuleDescriptor) -> ShaderModuleId raise HalErrorfn create_texture_view(self : Unbound, _texture : TextureId, _descriptor : TextureViewDescriptor) -> TextureViewId raise HalErrorInstall
Download zipThe WebGPU API for MoonBit.