This repo contains a MoonBit port of the `wgpu-native` C API (WebGPU)
Dependencies
| Platform | Status | Validated in repo | Surface API |
|---|---|---|---|
| macOS | supported | Metal runtime + host-backed surface tests in CI | Instance::create_surface_from_window() / create_surface_metal_layer() |
| Linux | experimental | Vulkan headless runtime + Linux descriptor/input validation in CI | Instance::create_surface_from_window() / platform constructors |
| Windows | experimental | Vulkan headless runtime + Windows descriptor/input validation in CI | Instance::create_surface_from_window() / platform constructors |
| Android | unsupported by repo build matrix | API only; no pinned build path or runtime validation | Instance::create_surface_android_native_window() |
{
"import": [
{ "path": "Milky2018/wgpu_mbt", "alias": "wgpu" }
]
}| Platform / Arch | Dynamic archive | Library inside archive |
|---|---|---|
| macOS x64 | wgpu-macos-x86_64-release.zip | lib/libwgpu_native.dylib |
| macOS arm64 | wgpu-macos-aarch64-release.zip | lib/libwgpu_native.dylib |
| Linux x64 | wgpu-linux-x86_64-release.zip | lib/libwgpu_native.so |
| Linux arm64 | wgpu-linux-aarch64-release.zip | lib/libwgpu_native.so |
| Windows x64 | wgpu-windows-x86_64-msvc-release.zip | lib/wgpu_native.dll |
| Windows arm64 | wgpu-windows-aarch64-msvc-release.zip | lib/wgpu_native.dll |
fn main {
try {
@wgpu.with_default_device_queue_managed((instance, device, queue) => {
let _ = instance
let buf = device.create_buffer(
size=4UL,
usage=@wgpu.BufferUsage::from_u64(@wgpu.BUFFER_USAGE_COPY_DST),
)
ignore(buf.size())
let shader = device.create_shader_module_wgsl(
#|@compute @workgroup_size(1)
#|fn main() {}
#|,
)
let pipeline = device.create_compute_pipeline(shader)
let encoder = device.create_command_encoder()
let pass = encoder.begin_compute_pass()
pass.set_pipeline(pipeline)
pass.dispatch_workgroups(1U, 1U, 1U)
pass.end()
let cmd = encoder.finish()
queue.submit_one(cmd)
})
} catch {
e => println(e.message())
}
}let config = @wgpu.SurfaceConfiguration::new(
width,
height,
usage,
format,
@wgpu.PresentMode::from_u32(present_mode_u32),
@wgpu.CompositeAlphaMode::from_u32(alpha_mode_u32),
)
.with_view_formats([format])
.with_desired_maximum_frame_latency(2U)
surface.configure_with_or_raise(adapter, device, config)let surface = instance.create_surface_from_window(window)surface.sync_macos_window_handle(window.window_handle())type BufferSyncErrortype ComputePipelineDescErrortype OptionalSymbolErrortype QueueWorkDoneErrortype QueueWorkDoneWaitErrortype RenderPassDescErrortype RenderPipelineDescErrortype SurfaceConfigureErrortype SurfaceCreateErrortype SurfacePresentErrortype SurfaceTextureErrortype WaitAnyErrorpub suberror WgpuError {
WgpuNativeUnavailable(String)
WgpuNativeUnsupported(String)
WgpuNativeMissingSymbol(String, String)
WgpuRequestAdapterFailed(UInt)
WgpuRequestDeviceFailed(UInt)
}fn Adapter::request_device_future_id_u64(self : Adapter, descriptor? : WGPUDeviceDescriptorPtr) -> UInt64fn Adapter::request_device_sync_with_features_and_limits(self : Adapter, instance : Instance, required_features_u32 : Array[UInt], max_bind_groups_u32? : UInt, max_dynamic_uniform_buffers_u32? : UInt, max_uniform_buffer_binding_size? : UInt64, max_storage_buffer_binding_size? : UInt64, max_sampled_textures_per_shader_stage_u32? : UInt, max_samplers_per_shader_stage_u32? : UInt, max_immediate_size_u32? : UInt, max_non_sampler_bindings_u32? : UInt, max_binding_array_elements_per_shader_stage_u32? : UInt, max_binding_array_sampler_elements_per_shader_stage_u32? : UInt, label? : String, queue_label? : String, trace_path? : String) -> Device raise WgpuErrorpub struct AutoReleasePool {
// private fields
}fn AutoReleasePool::track_bind_group_layout(self : AutoReleasePool, layout : BindGroupLayout) -> BindGroupLayoutfn AutoReleasePool::track_command_buffer(self : AutoReleasePool, command_buffer : CommandBuffer) -> CommandBufferfn AutoReleasePool::track_command_encoder(self : AutoReleasePool, encoder : CommandEncoder) -> CommandEncoderfn AutoReleasePool::track_compute_pipeline(self : AutoReleasePool, pipeline : ComputePipeline) -> ComputePipelinefn AutoReleasePool::track_pipeline_layout(self : AutoReleasePool, layout : PipelineLayout) -> PipelineLayoutfn AutoReleasePool::track_render_bundle(self : AutoReleasePool, bundle : RenderBundle) -> RenderBundlefn AutoReleasePool::track_render_bundle_encoder(self : AutoReleasePool, encoder : RenderBundleEncoder) -> RenderBundleEncoderfn AutoReleasePool::track_render_pipeline(self : AutoReleasePool, pipeline : RenderPipeline) -> RenderPipelinefn AutoReleasePool::track_shader_module(self : AutoReleasePool, shader : ShaderModule) -> ShaderModulefn BindGroupBuilder::add_buffer(self : BindGroupBuilder, binding : UInt, buffer : Buffer, offset? : UInt64, size? : UInt64) -> Boolfn BindGroupBuilder::add_buffer_array(self : BindGroupBuilder, binding : UInt, buffers : Array[Buffer], offset? : UInt64, size? : UInt64) -> Boolfn BindGroupBuilder::add_sampler(self : BindGroupBuilder, binding : UInt, sampler : Sampler) -> Boolfn BindGroupBuilder::add_sampler_array(self : BindGroupBuilder, binding : UInt, samplers : Array[Sampler]) -> Boolfn BindGroupBuilder::add_texture_view(self : BindGroupBuilder, binding : UInt, view : TextureView) -> Boolfn BindGroupBuilder::add_texture_view_array(self : BindGroupBuilder, binding : UInt, views : Array[TextureView]) -> Boolfn BindGroupBuilder::finish(self : BindGroupBuilder, device : Device, layout : BindGroupLayout, label? : String) -> BindGroupfn BindGroupLayoutBuilder::add_buffer(self : BindGroupLayoutBuilder, binding : UInt, visibility : ShaderStage, type_u32 : UInt, has_dynamic_offset? : Bool, min_binding_size? : UInt64, count? : UInt) -> Boolfn BindGroupLayoutBuilder::add_sampler(self : BindGroupLayoutBuilder, binding : UInt, visibility : ShaderStage, type_u32 : UInt, count? : UInt) -> Boolfn BindGroupLayoutBuilder::add_storage_texture(self : BindGroupLayoutBuilder, binding : UInt, visibility : ShaderStage, access_u32 : UInt, format : TextureFormat, view_dimension_u32 : UInt, count? : UInt) -> Boolfn BindGroupLayoutBuilder::add_texture(self : BindGroupLayoutBuilder, binding : UInt, visibility : ShaderStage, sample_type_u32 : UInt, view_dimension_u32 : UInt, multisampled? : Bool, count? : UInt) -> Boolfn BindGroupLayoutBuilder::finish(self : BindGroupLayoutBuilder, device : Device, label? : String) -> BindGroupLayoutfn Buffer::map_read_sync_or_raise(self : Buffer, instance : Instance, offset : UInt64, size : UInt64) -> Bytes raise BufferSyncErrorfn Buffer::map_write_sync_or_raise(self : Buffer, instance : Instance, offset : UInt64, data : Bytes) -> Unit raise BufferSyncErrorfn Buffer::readback_or_raise(self : Buffer, instance : Instance, offset : UInt64, size : UInt64) -> Bytes raise BufferSyncErrorfn CommandEncoder::begin_compute_pass_ptr(self : CommandEncoder, descriptor : WGPUComputePassDescriptorPtr) -> ComputePassfn CommandEncoder::begin_compute_pass_raw(self : CommandEncoder, descriptor : WGPUComputePassDescriptorPtr) -> ComputePassfn CommandEncoder::begin_render_pass(self : CommandEncoder, descriptor : WGPURenderPassDescriptorPtr) -> RenderPassfn CommandEncoder::begin_render_pass_color1_depth_u32(self : CommandEncoder, color1_view : TextureView, depth_view : TextureView, color1_load_op_u32? : UInt, color1_store_op_u32? : UInt, color1_clear_r_f32? : Float, color1_clear_g_f32? : Float, color1_clear_b_f32? : Float, color1_clear_a_f32? : Float, depth_load_op_u32? : UInt, depth_store_op_u32? : UInt, depth_clear_value_f32? : Float, depth_read_only? : Bool, stencil_load_op_u32? : UInt, stencil_store_op_u32? : UInt, stencil_clear_value_u32? : UInt, stencil_read_only? : Bool) -> RenderPassfn CommandEncoder::begin_render_pass_color2(self : CommandEncoder, view0 : TextureView, view1 : TextureView) -> RenderPassfn CommandEncoder::begin_render_pass_color2_depth(self : CommandEncoder, color0_view : TextureView, color1_view : TextureView, depth_view : TextureView) -> RenderPassfn CommandEncoder::begin_render_pass_color2_depth_sparse_u32(self : CommandEncoder, color0_view : TextureView, color1_view : TextureView, depth_view : TextureView, color0_load_op_u32? : UInt, color0_store_op_u32? : UInt, color0_clear_r_f32? : Float, color0_clear_g_f32? : Float, color0_clear_b_f32? : Float, color0_clear_a_f32? : Float, color1_load_op_u32? : UInt, color1_store_op_u32? : UInt, color1_clear_r_f32? : Float, color1_clear_g_f32? : Float, color1_clear_b_f32? : Float, color1_clear_a_f32? : Float, depth_load_op_u32? : UInt, depth_store_op_u32? : UInt, depth_clear_value_f32? : Float, depth_read_only? : Bool, stencil_load_op_u32? : UInt, stencil_store_op_u32? : UInt, stencil_clear_value_u32? : UInt, stencil_read_only? : Bool) -> RenderPassfn CommandEncoder::begin_render_pass_color2_depth_u32(self : CommandEncoder, color0_view : TextureView, color1_view : TextureView, depth_view : TextureView, color0_load_op_u32? : UInt, color0_store_op_u32? : UInt, color0_clear_r_f32? : Float, color0_clear_g_f32? : Float, color0_clear_b_f32? : Float, color0_clear_a_f32? : Float, color1_load_op_u32? : UInt, color1_store_op_u32? : UInt, color1_clear_r_f32? : Float, color1_clear_g_f32? : Float, color1_clear_b_f32? : Float, color1_clear_a_f32? : Float, depth_load_op_u32? : UInt, depth_store_op_u32? : UInt, depth_clear_value_f32? : Float, depth_read_only? : Bool, stencil_load_op_u32? : UInt, stencil_store_op_u32? : UInt, stencil_clear_value_u32? : UInt, stencil_read_only? : Bool) -> RenderPassfn CommandEncoder::begin_render_pass_color_clear(self : CommandEncoder, view : TextureView, r : Float, g : Float, b : Float, a : Float) -> RenderPassfn CommandEncoder::begin_render_pass_color_depth(self : CommandEncoder, color_view : TextureView, depth_view : TextureView) -> RenderPassfn CommandEncoder::begin_render_pass_color_depth_u32(self : CommandEncoder, color_view : TextureView, depth_view : TextureView, color_load_op_u32? : UInt, color_store_op_u32? : UInt, color_clear_r_f32? : Float, color_clear_g_f32? : Float, color_clear_b_f32? : Float, color_clear_a_f32? : Float, depth_load_op_u32? : UInt, depth_store_op_u32? : UInt, depth_clear_value_f32? : Float, depth_read_only? : Bool, stencil_load_op_u32? : UInt, stencil_store_op_u32? : UInt, stencil_clear_value_u32? : UInt, stencil_read_only? : Bool) -> RenderPassfn CommandEncoder::begin_render_pass_color_load(self : CommandEncoder, view : TextureView) -> RenderPassfn CommandEncoder::begin_render_pass_color_occlusion(self : CommandEncoder, view : TextureView, query_set : QuerySet) -> RenderPassfn CommandEncoder::begin_render_pass_depth(self : CommandEncoder, depth_view : TextureView) -> RenderPassfn CommandEncoder::begin_render_pass_depth_u32(self : CommandEncoder, depth_view : TextureView, depth_load_op_u32? : UInt, depth_store_op_u32? : UInt, depth_clear_value_f32? : Float, depth_read_only? : Bool, stencil_load_op_u32? : UInt, stencil_store_op_u32? : UInt, stencil_clear_value_u32? : UInt, stencil_read_only? : Bool) -> RenderPassfn CommandEncoder::begin_render_pass_desc_builder(self : CommandEncoder, builder : RenderPassDescBuilder) -> RenderPass raise RenderPassDescErrorfn CommandEncoder::begin_render_pass_ptr(self : CommandEncoder, descriptor : WGPURenderPassDescriptorPtr) -> RenderPassfn CommandEncoder::clear_buffer(self : CommandEncoder, buffer : Buffer, offset : UInt64, size : UInt64) -> Unitfn CommandEncoder::clear_buffer_raw(self : CommandEncoder, buffer : Buffer, offset : UInt64, size : UInt64) -> Unitfn CommandEncoder::copy_buffer_to_buffer(self : CommandEncoder, source : Buffer, source_offset : UInt64, destination : Buffer, destination_offset : UInt64, size : UInt64) -> Unitfn CommandEncoder::copy_buffer_to_buffer_raw(self : CommandEncoder, source : Buffer, source_offset : UInt64, destination : Buffer, destination_offset : UInt64, size : UInt64) -> Unitfn CommandEncoder::copy_buffer_to_texture(self : CommandEncoder, source : WGPUTexelCopyBufferInfoPtr, destination : WGPUTexelCopyTextureInfoPtr, copy_size : WGPUExtent3DPtr) -> Unitfn CommandEncoder::copy_buffer_to_texture_ptr(self : CommandEncoder, source : WGPUTexelCopyBufferInfoPtr, destination : WGPUTexelCopyTextureInfoPtr, copy_size : WGPUExtent3DPtr) -> Unitfn CommandEncoder::copy_buffer_to_texture_rgba8(self : CommandEncoder, buffer : Buffer, texture : Texture, width : UInt, height : UInt) -> Unitfn CommandEncoder::copy_buffer_to_texture_rgba8_mip_layer(self : CommandEncoder, buffer : Buffer, texture : Texture, mip_level : UInt, array_layer : UInt, width : UInt, height : UInt) -> Unitfn CommandEncoder::copy_texture_to_buffer(self : CommandEncoder, source : WGPUTexelCopyTextureInfoPtr, destination : WGPUTexelCopyBufferInfoPtr, copy_size : WGPUExtent3DPtr) -> Unitfn CommandEncoder::copy_texture_to_buffer_bytes_per_pixel(self : CommandEncoder, texture : Texture, buffer : Buffer, width : UInt, height : UInt, bytes_per_pixel : UInt) -> Unitfn CommandEncoder::copy_texture_to_buffer_bytes_per_pixel_mip_layer(self : CommandEncoder, texture : Texture, mip_level : UInt, array_layer : UInt, buffer : Buffer, width : UInt, height : UInt, bytes_per_pixel : UInt) -> Unitfn CommandEncoder::copy_texture_to_buffer_ptr(self : CommandEncoder, source : WGPUTexelCopyTextureInfoPtr, destination : WGPUTexelCopyBufferInfoPtr, copy_size : WGPUExtent3DPtr) -> Unitfn CommandEncoder::copy_texture_to_buffer_rgba8(self : CommandEncoder, texture : Texture, buffer : Buffer, width : UInt, height : UInt) -> Unitfn CommandEncoder::copy_texture_to_buffer_rgba8_mip_layer(self : CommandEncoder, texture : Texture, mip_level : UInt, array_layer : UInt, buffer : Buffer, width : UInt, height : UInt) -> Unitfn CommandEncoder::copy_texture_to_texture(self : CommandEncoder, source : WGPUTexelCopyTextureInfoPtr, destination : WGPUTexelCopyTextureInfoPtr, copy_size : WGPUExtent3DPtr) -> Unitfn CommandEncoder::copy_texture_to_texture_ptr(self : CommandEncoder, source : WGPUTexelCopyTextureInfoPtr, destination : WGPUTexelCopyTextureInfoPtr, copy_size : WGPUExtent3DPtr) -> Unitfn CommandEncoder::copy_texture_to_texture_rgba8(self : CommandEncoder, src : Texture, dst : Texture, width : UInt, height : UInt) -> Unitfn CommandEncoder::copy_texture_to_texture_rgba8_mip_layer(self : CommandEncoder, src : Texture, src_mip_level : UInt, src_array_layer : UInt, dst : Texture, dst_mip_level : UInt, dst_array_layer : UInt, width : UInt, height : UInt) -> Unitfn CommandEncoder::finish_ptr(self : CommandEncoder, descriptor : WGPUCommandBufferDescriptorPtr) -> CommandBufferfn CommandEncoder::finish_raw(self : CommandEncoder, descriptor : WGPUCommandBufferDescriptorPtr) -> CommandBufferfn CommandEncoder::resolve_query_set(self : CommandEncoder, query_set : QuerySet, first_query : UInt, query_count : UInt, destination : Buffer, destination_offset : UInt64) -> Unitfn CommandEncoder::resolve_query_set_raw(self : CommandEncoder, query_set : QuerySet, first_query : UInt, query_count : UInt, destination : Buffer, destination_offset : UInt64) -> Unitfn CommandEncoder::write_timestamp(self : CommandEncoder, query_set : QuerySet, query_index : UInt) -> Unitfn CommandEncoder::write_timestamp_raw(self : CommandEncoder, query_set : QuerySet, query_index : UInt) -> Unitpub struct CompilationMessage {
type_u32 : UInt
line_num_u64 : UInt64
line_pos_u64 : UInt64
offset_u64 : UInt64
length_u64 : UInt64
text : String
}pub struct CompositeAlphaMode {
raw : UInt
}fn ComputePass::begin_pipeline_statistics_query(self : ComputePass, query_set : QuerySet, query_index : UInt) -> Unitfn ComputePass::begin_pipeline_statistics_query_raw(self : ComputePass, query_set : QuerySet, query_index : UInt) -> Unitfn ComputePass::dispatch_workgroups_indirect(self : ComputePass, indirect_buffer : Buffer, indirect_offset : UInt64) -> Unitfn ComputePass::dispatch_workgroups_indirect_raw(self : ComputePass, indirect_buffer : Buffer, indirect_offset : UInt64) -> Unitfn ComputePass::dispatch_workgroups_raw(self : ComputePass, workgroup_count_x : UInt, workgroup_count_y : UInt, workgroup_count_z : UInt) -> Unitfn ComputePass::set_bind_group(self : ComputePass, index : UInt, group : BindGroup, dynamic_offsets : Array[UInt]) -> Unitfn ComputePass::write_timestamp(self : ComputePass, query_set : QuerySet, query_index : UInt) -> Unitfn ComputePass::write_timestamp_raw(self : ComputePass, query_set : QuerySet, query_index : UInt) -> Unitfn ComputePipeline::get_bind_group_layout_raw(self : ComputePipeline, group_index : UInt) -> BindGroupLayoutfn ComputePipelineDescBuilder::create_pipeline(self : ComputePipelineDescBuilder, device : Device) -> ComputePipeline raise ComputePipelineDescErrorfn ComputePipelineDescBuilder::finish_descriptor_ptr(self : ComputePipelineDescBuilder) -> WGPUComputePipelineDescriptorPtr raise ComputePipelineDescErrorfn ComputePipelineDescBuilder::last_error(self : ComputePipelineDescBuilder) -> ComputePipelineDescErrorfn ComputePipelineDescBuilder::new(shader_module : ShaderModule, layout? : PipelineLayout) -> ComputePipelineDescBuilder raise ComputePipelineDescErrorfn ComputePipelineDescBuilder::set_entry_point(self : ComputePipelineDescBuilder, entry_point : String) -> Unit raise ComputePipelineDescErrorfn Device::create_bind_group_layout(self : Device, descriptor : WGPUBindGroupLayoutDescriptorPtr) -> BindGroupLayoutfn Device::create_bind_group_layout_ptr(self : Device, descriptor : WGPUBindGroupLayoutDescriptorPtr) -> BindGroupLayoutfn Device::create_bind_group_layout_storage_texture_rgba8_writeonly(self : Device) -> BindGroupLayoutfn Device::create_bind_group_ptr(self : Device, descriptor : WGPUBindGroupDescriptorPtr) -> BindGroupfn Device::create_bind_group_sampler(self : Device, bind_group_layout : BindGroupLayout, sampler : Sampler) -> BindGroupfn Device::create_bind_group_sampler_texture_2d(self : Device, bind_group_layout : BindGroupLayout, sampler : Sampler, view : TextureView) -> BindGroupfn Device::create_bind_group_storage_buffer(self : Device, bind_group_layout : BindGroupLayout, buffer : Buffer) -> BindGroupfn Device::create_bind_group_storage_texture_2d(self : Device, bind_group_layout : BindGroupLayout, view : TextureView) -> BindGroupfn Device::create_bind_group_texture_2d(self : Device, bind_group_layout : BindGroupLayout, view : TextureView) -> BindGroupfn Device::create_bind_group_uniform_buffer(self : Device, bind_group_layout : BindGroupLayout, buffer : Buffer) -> BindGroupfn Device::create_bind_group_uniform_buffer_16(self : Device, bind_group_layout : BindGroupLayout, buffer : Buffer) -> BindGroupfn Device::create_buffer(self : Device, size~ : UInt64, usage~ : BufferUsage, mapped_at_creation? : Bool) -> Bufferfn Device::create_command_encoder_ptr(self : Device, descriptor : WGPUCommandEncoderDescriptorPtr) -> CommandEncoderfn Device::create_command_encoder_raw(self : Device, descriptor : WGPUCommandEncoderDescriptorPtr) -> CommandEncoderfn Device::create_compute_pipeline_async_sync_ptr(self : Device, instance : Instance, descriptor : WGPUComputePipelineDescriptorPtr) -> ComputePipelinefn Device::create_compute_pipeline_async_sync_ptr_or_raise(self : Device, instance : Instance, descriptor : WGPUComputePipelineDescriptorPtr) -> ComputePipeline raise OptionalSymbolErrorfn Device::create_compute_pipeline_entry(self : Device, shader_module : ShaderModule, entry_point : String) -> ComputePipeline raise ComputePipelineDescErrorfn Device::create_compute_pipeline_ptr(self : Device, descriptor : WGPUComputePipelineDescriptorPtr) -> ComputePipelinefn Device::create_compute_pipeline_raw(self : Device, descriptor : WGPUComputePipelineDescriptorPtr) -> ComputePipelinefn Device::create_compute_pipeline_with_layout(self : Device, layout : PipelineLayout, shader_module : ShaderModule) -> ComputePipelinefn Device::create_compute_pipeline_with_layout_entry(self : Device, layout : PipelineLayout, shader_module : ShaderModule, entry_point : String) -> ComputePipeline raise ComputePipelineDescErrorfn Device::create_pipeline_layout(self : Device, descriptor : WGPUPipelineLayoutDescriptorPtr) -> PipelineLayoutfn Device::create_pipeline_layout_1(self : Device, bind_group_layout : BindGroupLayout) -> PipelineLayoutfn Device::create_pipeline_layout_2(self : Device, bind_group_layout0 : BindGroupLayout, bind_group_layout1 : BindGroupLayout) -> PipelineLayoutfn Device::create_pipeline_layout_immediates(self : Device, stages : ShaderStage, start : UInt, end : UInt) -> PipelineLayoutfn Device::create_pipeline_layout_immediates_many(self : Device, first_stages : ShaderStage, first_start : UInt, first_end : UInt, other_ranges : Array[(ShaderStage, UInt, UInt)]) -> PipelineLayoutfn Device::create_pipeline_layout_many(self : Device, bind_group_layouts : Array[BindGroupLayout]) -> PipelineLayoutfn Device::create_pipeline_layout_ptr(self : Device, descriptor : WGPUPipelineLayoutDescriptorPtr) -> PipelineLayoutfn Device::create_pipeline_layout_with_immediates(self : Device, bind_group_layouts : Array[BindGroupLayout], ranges : Array[(ShaderStage, UInt, UInt)]) -> PipelineLayoutfn Device::create_render_bundle_encoder(self : Device, descriptor : WGPURenderBundleEncoderDescriptorPtr) -> RenderBundleEncoderfn Device::create_render_bundle_encoder_ptr(self : Device, descriptor : WGPURenderBundleEncoderDescriptorPtr) -> RenderBundleEncoderfn Device::create_render_pipeline(self : Device, descriptor : WGPURenderPipelineDescriptorPtr) -> RenderPipelinefn Device::create_render_pipeline_async_sync_ptr(self : Device, instance : Instance, descriptor : WGPURenderPipelineDescriptorPtr) -> RenderPipelinefn Device::create_render_pipeline_async_sync_ptr_or_raise(self : Device, instance : Instance, descriptor : WGPURenderPipelineDescriptorPtr) -> RenderPipeline raise OptionalSymbolErrorfn Device::create_render_pipeline_color_format(self : Device, shader_module : ShaderModule, format : TextureFormat) -> RenderPipelinefn Device::create_render_pipeline_color_format_alpha_blend(self : Device, shader_module : ShaderModule, format : TextureFormat) -> RenderPipelinefn Device::create_render_pipeline_color_format_entries(self : Device, shader_module : ShaderModule, format : TextureFormat, vs_entry? : String, fs_entry? : String, alpha_blend? : Bool, depth? : Bool, color_write_mask? : UInt64) -> RenderPipelinefn Device::create_render_pipeline_ptr(self : Device, descriptor : WGPURenderPipelineDescriptorPtr) -> RenderPipelinefn Device::create_render_pipeline_rgba8(self : Device, shader_module : ShaderModule) -> RenderPipelinefn Device::create_render_pipeline_rgba8_alpha_blend(self : Device, shader_module : ShaderModule) -> RenderPipelinefn Device::create_render_pipeline_rgba8_depth(self : Device, shader_module : ShaderModule) -> RenderPipelinefn Device::create_render_pipeline_rgba8_mrt2(self : Device, shader_module : ShaderModule) -> RenderPipelinefn Device::create_render_pipeline_rgba8_pos2(self : Device, shader_module : ShaderModule) -> RenderPipelinefn Device::create_render_pipeline_rgba8_pos2_with_layout(self : Device, layout : PipelineLayout, shader_module : ShaderModule) -> RenderPipelinefn Device::create_render_pipeline_rgba8_with_layout(self : Device, layout : PipelineLayout, shader_module : ShaderModule) -> RenderPipelinefn Device::create_sampler_u32(self : Device, address_mode_u_u32 : UInt, address_mode_v_u32 : UInt, address_mode_w_u32 : UInt, mag_filter_u32 : UInt, min_filter_u32 : UInt, mipmap_filter_u32 : UInt, lod_min_clamp_f32? : Float, lod_max_clamp_f32? : Float, compare_u32? : UInt, max_anisotropy_u32? : UInt) -> Samplerfn Device::create_shader_module(self : Device, descriptor : WGPUShaderModuleDescriptorPtr) -> ShaderModulefn Device::create_shader_module_glsl(self : Device, stage_u64 : UInt64, code : String) -> ShaderModulefn Device::create_shader_module_ptr(self : Device, descriptor : WGPUShaderModuleDescriptorPtr) -> ShaderModulefn Device::create_shader_module_spir_v(self : Device, descriptor : WGPUShaderModuleDescriptorSpirVPtr) -> ShaderModulefn Device::create_texture_rgba8_2d_array_with_usage(self : Device, width : UInt, height : UInt, layers : UInt, mip_level_count : UInt, usage : TextureUsage) -> Texturefn Device::create_texture_rgba8_2d_with_usage(self : Device, width : UInt, height : UInt, usage : TextureUsage) -> Texturefn Device::create_texture_u32(self : Device, width : UInt, height : UInt, depth_or_array_layers : UInt, usage : TextureUsage, dimension : TextureDimension, format : TextureFormat, mip_level_count? : UInt, sample_count? : UInt, view_formats? : Array[TextureFormat]) -> Texturefn[T : HasWindowHandle + HasDisplayHandle] Instance::create_surface_from_window(self : Instance, window : T) -> Surface raise SurfaceCreateErrorfn Instance::create_surface_from_window_handles(self : Instance, window_handle : WindowHandle, display_handle : DisplayHandle) -> Surface raise SurfaceCreateErrorfn Instance::create_surface_macos_ns_view(self : Instance, ns_view : OpaquePtr) -> Surface raise SurfaceCreateErrorfn Instance::create_surface_macos_ns_view_u64(self : Instance, ns_view : UInt64) -> Surface raise SurfaceCreateErrorfn Instance::enumerate_adapters(self : Instance, options : WGPUInstanceEnumerateAdapterOptionsPtr, adapters : WGPUAdapterPtr) -> UInt64fn Instance::get_wgsl_language_features(self : Instance, features : WGPUSupportedWGSLLanguageFeaturesPtr) -> WGPUStatusfn Instance::has_wgsl_language_feature(self : Instance, feature : WGPUWGSLLanguageFeatureName) -> Boolfn Instance::request_adapter_future_id_u64(self : Instance, options? : WGPURequestAdapterOptionsPtr) -> UInt64fn Instance::request_adapter_sync_ptr(self : Instance, options : WGPURequestAdapterOptionsPtr) -> Adapter raise WgpuErrorfn Instance::wait_any(self : Instance, future_count : UInt64, futures : WGPUFutureWaitInfoPtr, timeout_ns : UInt64) -> WGPUWaitStatusfn Instance::wait_any_one(self : Instance, future_id : UInt64, timeout_ns? : UInt64) -> WaitAnyResultfn Instance::wait_any_one_or_raise(self : Instance, future_id : UInt64, timeout_ns? : UInt64) -> WaitAnyResult raise WaitAnyErrorfn Instance::with_device_queue_auto_release(self : Instance, run : (Device, Queue, AutoReleasePool) -> Unit raise) -> Unit raisefn Instance::with_device_queue_managed(self : Instance, run : (ManagedDevice, ManagedQueue) -> Unit raise) -> Unit raisepub struct InstanceCapabilities {
timed_wait_any_enable : Bool
timed_wait_any_max_count : UInt64
}pub struct ManagedBuffer {
// private fields
}fn ManagedBuffer::readback(self : ManagedBuffer, instance : Instance, offset : UInt64, size : UInt64) -> Bytespub struct ManagedCommandEncoder {
// private fields
}fn ManagedCommandEncoder::begin_render_pass_color(self : ManagedCommandEncoder, view : ManagedTextureView) -> ManagedRenderPassfn ManagedCommandEncoder::copy_texture_to_buffer_rgba8(self : ManagedCommandEncoder, texture : ManagedTexture, buffer : ManagedBuffer, width : UInt, height : UInt) -> Unitpub struct ManagedComputePass {
// private fields
}fn ManagedComputePass::dispatch_workgroups(self : ManagedComputePass, x : UInt, y : UInt, z : UInt) -> Unitfn ManagedComputePass::set_pipeline(self : ManagedComputePass, pipeline : ManagedComputePipeline) -> Unitpub struct ManagedDevice {
// private fields
}fn ManagedDevice::create_buffer(self : ManagedDevice, size~ : UInt64, usage~ : BufferUsage, mapped_at_creation? : Bool) -> ManagedBufferfn ManagedDevice::create_compute_pipeline(self : ManagedDevice, shader_module : ManagedShaderModule) -> ManagedComputePipelinefn ManagedDevice::create_render_pipeline_rgba8(self : ManagedDevice, shader_module : ManagedShaderModule) -> ManagedRenderPipelinefn ManagedDevice::create_shader_module_wgsl(self : ManagedDevice, code : String) -> ManagedShaderModulefn ManagedDevice::create_texture_rgba8_2d(self : ManagedDevice, width : UInt, height : UInt) -> ManagedTexturepub struct ManagedQueue {
// private fields
}pub struct ManagedRenderPass {
// private fields
}fn ManagedRenderPass::draw(self : ManagedRenderPass, vertex_count : UInt, instance_count : UInt, first_vertex : UInt, first_instance : UInt) -> Unitfn ManagedRenderPass::set_pipeline(self : ManagedRenderPass, pipeline : ManagedRenderPipeline) -> Unitpub struct ManagedTexture {
// private fields
}pub struct MapMode {
raw : UInt64
}fn Queue::on_submitted_work_done_async_take_or_raise(self : Queue, future_id : UInt64) -> Unit raise QueueWorkDoneErrorfn Queue::on_submitted_work_done_sync_or_raise(self : Queue, instance : Instance) -> Unit raise QueueWorkDoneErrorfn Queue::on_submitted_work_done_wait_or_raise(self : Queue, instance : Instance, timeout_ns? : UInt64) -> Unit raise QueueWorkDoneWaitErrorfn Queue::submit_for_index_raw(self : Queue, command_count : UInt64, commands : WGPUCommandBufferPtr) -> UInt64fn Queue::submit_one_and_map_read_async(self : Queue, cmd : CommandBuffer, buffer : Buffer, offset : UInt64, size : UInt64) -> UInt64fn Queue::write_texture_ptr(self : Queue, destination : WGPUTexelCopyTextureInfoPtr, data : Bytes, data_layout : WGPUTexelCopyBufferLayoutPtr, write_size : WGPUExtent3DPtr, data_size? : UInt64) -> Unitfn RenderBundleEncoder::draw(self : RenderBundleEncoder, vertex_count : UInt, instance_count : UInt, first_vertex : UInt, first_instance : UInt) -> Unitfn RenderBundleEncoder::draw_indexed(self : RenderBundleEncoder, index_count : UInt, instance_count : UInt, first_index : UInt, base_vertex : Int, first_instance : UInt) -> Unitfn RenderBundleEncoder::draw_indexed_indirect(self : RenderBundleEncoder, indirect_buffer : Buffer, indirect_offset : UInt64) -> Unitfn RenderBundleEncoder::draw_indexed_indirect_raw(self : RenderBundleEncoder, indirect_buffer : Buffer, indirect_offset : UInt64) -> Unitfn RenderBundleEncoder::draw_indexed_raw(self : RenderBundleEncoder, index_count : UInt, instance_count : UInt, first_index : UInt, base_vertex : Int, first_instance : UInt) -> Unitfn RenderBundleEncoder::draw_indirect(self : RenderBundleEncoder, indirect_buffer : Buffer, indirect_offset : UInt64) -> Unitfn RenderBundleEncoder::draw_indirect_raw(self : RenderBundleEncoder, indirect_buffer : Buffer, indirect_offset : UInt64) -> Unitfn RenderBundleEncoder::draw_raw(self : RenderBundleEncoder, vertex_count : UInt, instance_count : UInt, first_vertex : UInt, first_instance : UInt) -> Unitfn RenderBundleEncoder::finish_ptr(self : RenderBundleEncoder, descriptor : WGPURenderBundleDescriptorPtr) -> RenderBundlefn RenderBundleEncoder::finish_raw(self : RenderBundleEncoder, descriptor : WGPURenderBundleDescriptorPtr) -> RenderBundlefn RenderBundleEncoder::set_bind_group(self : RenderBundleEncoder, index : UInt, group : BindGroup, dynamic_offsets : Array[UInt]) -> Unitfn RenderBundleEncoder::set_immediates(self : RenderBundleEncoder, stages : ShaderStage, offset : UInt, data : Bytes) -> Unitfn RenderBundleEncoder::set_index_buffer(self : RenderBundleEncoder, buffer : Buffer, format : WGPUIndexFormat, offset : UInt64, size : UInt64) -> Unitfn RenderBundleEncoder::set_index_buffer_u16(self : RenderBundleEncoder, buffer : Buffer, offset : UInt64, size : UInt64) -> Unitfn RenderBundleEncoder::set_index_buffer_u32(self : RenderBundleEncoder, buffer : Buffer, offset : UInt64, size : UInt64) -> Unitfn RenderBundleEncoder::set_pipeline_raw(self : RenderBundleEncoder, pipeline : RenderPipeline) -> Unitfn RenderBundleEncoder::set_vertex_buffer(self : RenderBundleEncoder, slot : UInt, buffer : Buffer, offset : UInt64, size : UInt64) -> Unitfn RenderBundleEncoder::set_vertex_buffer_raw(self : RenderBundleEncoder, slot : UInt, buffer : Buffer, offset : UInt64, size : UInt64) -> Unitfn RenderPass::begin_pipeline_statistics_query(self : RenderPass, query_set : QuerySet, query_index : UInt) -> Unitfn RenderPass::begin_pipeline_statistics_query_raw(self : RenderPass, query_set : QuerySet, query_index : UInt) -> Unitfn RenderPass::draw(self : RenderPass, vertex_count : UInt, instance_count : UInt, first_vertex : UInt, first_instance : UInt) -> Unitfn RenderPass::draw_indexed(self : RenderPass, index_count : UInt, instance_count : UInt, first_index : UInt, base_vertex : Int, first_instance : UInt) -> Unitfn RenderPass::draw_indexed_indirect(self : RenderPass, indirect_buffer : Buffer, indirect_offset : UInt64) -> Unitfn RenderPass::draw_indexed_indirect_raw(self : RenderPass, indirect_buffer : Buffer, indirect_offset : UInt64) -> Unitfn RenderPass::draw_indexed_raw(self : RenderPass, index_count : UInt, instance_count : UInt, first_index : UInt, base_vertex : Int, first_instance : UInt) -> Unitfn RenderPass::draw_indirect(self : RenderPass, indirect_buffer : Buffer, indirect_offset : UInt64) -> Unitfn RenderPass::draw_indirect_raw(self : RenderPass, indirect_buffer : Buffer, indirect_offset : UInt64) -> Unitfn RenderPass::draw_raw(self : RenderPass, vertex_count : UInt, instance_count : UInt, first_vertex : UInt, first_instance : UInt) -> Unitfn RenderPass::execute_bundles_raw(self : RenderPass, bundle_count : UInt64, bundles : WGPURenderBundlePtr) -> Unitfn RenderPass::multi_draw_indexed_indirect(self : RenderPass, indirect_buffer : Buffer, indirect_offset : UInt64, count : UInt) -> Unitfn RenderPass::multi_draw_indexed_indirect_count(self : RenderPass, indirect_buffer : Buffer, indirect_offset : UInt64, count_buffer : Buffer, count_buffer_offset : UInt64, max_count : UInt) -> Unitfn RenderPass::multi_draw_indexed_indirect_count_raw(self : RenderPass, buffer : Buffer, offset : UInt64, count_buffer : Buffer, count_buffer_offset : UInt64, max_count : UInt) -> Unitfn RenderPass::multi_draw_indexed_indirect_raw(self : RenderPass, buffer : Buffer, offset : UInt64, count : UInt) -> Unitfn RenderPass::multi_draw_indirect(self : RenderPass, indirect_buffer : Buffer, indirect_offset : UInt64, count : UInt) -> Unitfn RenderPass::multi_draw_indirect_count(self : RenderPass, indirect_buffer : Buffer, indirect_offset : UInt64, count_buffer : Buffer, count_buffer_offset : UInt64, max_count : UInt) -> Unitfn RenderPass::multi_draw_indirect_count_raw(self : RenderPass, buffer : Buffer, offset : UInt64, count_buffer : Buffer, count_buffer_offset : UInt64, max_count : UInt) -> Unitfn RenderPass::multi_draw_indirect_raw(self : RenderPass, buffer : Buffer, offset : UInt64, count : UInt) -> Unitfn RenderPass::set_bind_group(self : RenderPass, index : UInt, group : BindGroup, dynamic_offsets : Array[UInt]) -> Unitfn RenderPass::set_blend_constant_rgba(self : RenderPass, r : Double, g : Double, b : Double, a : Double) -> Unitfn RenderPass::set_immediates(self : RenderPass, stages : ShaderStage, offset : UInt, data : Bytes) -> Unitfn RenderPass::set_index_buffer(self : RenderPass, buffer : Buffer, format : WGPUIndexFormat, offset : UInt64, size : UInt64) -> Unitfn RenderPass::set_index_buffer_u16(self : RenderPass, buffer : Buffer, offset : UInt64, size : UInt64) -> Unitfn RenderPass::set_index_buffer_u32(self : RenderPass, buffer : Buffer, offset : UInt64, size : UInt64) -> Unitfn RenderPass::set_scissor_rect(self : RenderPass, x : UInt, y : UInt, width : UInt, height : UInt) -> Unitfn RenderPass::set_scissor_rect_raw(self : RenderPass, x : UInt, y : UInt, width : UInt, height : UInt) -> Unitfn RenderPass::set_vertex_buffer(self : RenderPass, slot : UInt, buffer : Buffer, offset : UInt64, size : UInt64) -> Unitfn RenderPass::set_vertex_buffer_raw(self : RenderPass, slot : UInt, buffer : Buffer, offset : UInt64, size : UInt64) -> Unitfn RenderPass::set_viewport(self : RenderPass, x : Float, y : Float, width : Float, height : Float, min_depth : Float, max_depth : Float) -> Unitfn RenderPass::set_viewport_raw(self : RenderPass, x : Float, y : Float, width : Float, height : Float, min_depth : Float, max_depth : Float) -> Unitfn RenderPass::write_timestamp_raw(self : RenderPass, query_set : QuerySet, query_index : UInt) -> Unitfn RenderPassDescBuilder::begin(self : RenderPassDescBuilder, encoder : CommandEncoder) -> RenderPass raise RenderPassDescErrorfn RenderPassDescBuilder::clear_color_attachment_resolve_target(self : RenderPassDescBuilder, index_u32 : UInt) -> Unit raise RenderPassDescErrorfn RenderPassDescBuilder::clear_depth_stencil_attachment(self : RenderPassDescBuilder) -> Unit raise RenderPassDescErrorfn RenderPassDescBuilder::finish_descriptor_ptr(self : RenderPassDescBuilder) -> WGPURenderPassDescriptorPtr raise RenderPassDescErrorfn RenderPassDescBuilder::new(color_attachment_count : UInt) -> RenderPassDescBuilder raise RenderPassDescErrorfn RenderPassDescBuilder::set_color_attachment(self : RenderPassDescBuilder, index_u32 : UInt, view : TextureView, load_op_u32? : UInt, store_op_u32? : UInt, clear_r_f32? : Float, clear_g_f32? : Float, clear_b_f32? : Float, clear_a_f32? : Float) -> Unit raise RenderPassDescErrorfn RenderPassDescBuilder::set_color_attachment_resolve_target(self : RenderPassDescBuilder, index_u32 : UInt, resolve_target : TextureView) -> Unit raise RenderPassDescErrorfn RenderPassDescBuilder::set_depth_stencil_attachment(self : RenderPassDescBuilder, depth_view : TextureView, depth_load_op_u32? : UInt, depth_store_op_u32? : UInt, depth_clear_value_f32? : Float, stencil_load_op_u32? : UInt, stencil_store_op_u32? : UInt, stencil_clear_value_u32? : UInt, depth_read_only? : Bool, stencil_read_only? : Bool) -> Unit raise RenderPassDescErrorfn RenderPipeline::get_bind_group_layout_raw(self : RenderPipeline, group_index : UInt) -> BindGroupLayoutfn RenderPipelineDescBuilder::add_vertex_attribute(self : RenderPipelineDescBuilder, format_u32 : UInt, offset : UInt64, shader_location : UInt) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::add_vertex_buffer_layout(self : RenderPipelineDescBuilder, array_stride : UInt64, step_mode_u32 : UInt) -> UInt raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::clear_fragment(self : RenderPipelineDescBuilder) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::clear_primitive_extras(self : RenderPipelineDescBuilder) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::create_pipeline(self : RenderPipelineDescBuilder, device : Device) -> RenderPipeline raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::disable_blend(self : RenderPipelineDescBuilder) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::enable_alpha_blend(self : RenderPipelineDescBuilder) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::finish_descriptor_ptr(self : RenderPipelineDescBuilder) -> WGPURenderPipelineDescriptorPtr raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::last_error(self : RenderPipelineDescBuilder) -> RenderPipelineDescErrorfn RenderPipelineDescBuilder::new(shader_module : ShaderModule, layout? : PipelineLayout) -> RenderPipelineDescBuilder raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_blend_components(self : RenderPipelineDescBuilder, color_src_factor_u32 : UInt, color_dst_factor_u32 : UInt, color_operation_u32 : UInt, alpha_src_factor_u32 : UInt, alpha_dst_factor_u32 : UInt, alpha_operation_u32 : UInt) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_color_target_count(self : RenderPipelineDescBuilder, count_u32 : UInt) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_color_target_format(self : RenderPipelineDescBuilder, format : TextureFormat) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_color_target_format_at(self : RenderPipelineDescBuilder, index_u32 : UInt, format : TextureFormat) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_color_target_unused_at(self : RenderPipelineDescBuilder, index_u32 : UInt) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_color_target_write_mask(self : RenderPipelineDescBuilder, write_mask_u64 : UInt64) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_color_target_write_mask_at(self : RenderPipelineDescBuilder, index_u32 : UInt, write_mask_u64 : UInt64) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_conservative_rasterization(self : RenderPipelineDescBuilder, conservative : Bool) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_cull_mode_u32(self : RenderPipelineDescBuilder, cull_mode_u32 : UInt) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_depth_stencil(self : RenderPipelineDescBuilder, depth_format : TextureFormat, depth_write_enabled? : Bool, depth_compare_u32? : UInt, depth_bias? : Int, depth_bias_slope_scale? : Float, depth_bias_clamp? : Float) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_entry_points(self : RenderPipelineDescBuilder, vs_entry : String, fs_entry : String) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_fragment_module(self : RenderPipelineDescBuilder, shader_module : ShaderModule) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_multisample(self : RenderPipelineDescBuilder, count_u32 : UInt, mask_u32? : UInt, alpha_to_coverage_enabled? : Bool) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_polygon_mode_u32(self : RenderPipelineDescBuilder, polygon_mode_u32 : UInt) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_strip_index_format_u32(self : RenderPipelineDescBuilder, index_format_u32 : UInt) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_topology_u32(self : RenderPipelineDescBuilder, topology_u32 : UInt) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_unclipped_depth(self : RenderPipelineDescBuilder, unclipped_depth : Bool) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_vertex_buffer_layout(self : RenderPipelineDescBuilder, array_stride : UInt64, step_mode_u32 : UInt) -> Unit raise RenderPipelineDescErrorfn RenderPipelineDescBuilder::set_vertex_module(self : RenderPipelineDescBuilder, shader_module : ShaderModule) -> Unit raise RenderPipelineDescErrorfn ShaderModule::get_compilation_info_sync(self : ShaderModule, instance : Instance) -> CompilationInfofn ShaderModule::get_compilation_info_sync_or_raise(self : ShaderModule, instance : Instance) -> CompilationInfo raise OptionalSymbolErrorfn ShaderModule::get_compilation_info_sync_status_u32(self : ShaderModule, instance : Instance) -> UIntfn Surface::capabilities_format_u32_at(self : Surface, adapter : Adapter, index : UInt64) -> TextureFormatfn Surface::configure_best_effort(self : Surface, adapter : Adapter, device : Device, width : UInt, height : UInt, usage : TextureUsage, prefer_srgb? : Bool, vsync? : Bool, desired_maximum_frame_latency? : UInt) -> Boolfn Surface::configure_default(self : Surface, adapter : Adapter, device : Device, width : UInt, height : UInt, usage : TextureUsage, desired_maximum_frame_latency? : UInt) -> TextureFormatfn Surface::configure_u32(self : Surface, adapter : Adapter, device : Device, width : UInt, height : UInt, usage : TextureUsage, format : TextureFormat, present_mode_u32 : UInt, alpha_mode_u32 : UInt, desired_maximum_frame_latency? : UInt) -> Boolfn Surface::configure_u32_or_raise(self : Surface, adapter : Adapter, device : Device, width : UInt, height : UInt, usage : TextureUsage, format : TextureFormat, present_mode_u32 : UInt, alpha_mode_u32 : UInt, desired_maximum_frame_latency? : UInt) -> Unit raise SurfaceConfigureErrorfn Surface::configure_view_formats_u32(self : Surface, adapter : Adapter, device : Device, width : UInt, height : UInt, usage : TextureUsage, format : TextureFormat, present_mode_u32 : UInt, alpha_mode_u32 : UInt, view_formats : Array[TextureFormat], desired_maximum_frame_latency? : UInt) -> Boolfn Surface::configure_view_formats_u32_or_raise(self : Surface, adapter : Adapter, device : Device, width : UInt, height : UInt, usage : TextureUsage, format : TextureFormat, present_mode_u32 : UInt, alpha_mode_u32 : UInt, view_formats : Array[TextureFormat], desired_maximum_frame_latency? : UInt) -> Unit raise SurfaceConfigureErrorfn Surface::configure_with(self : Surface, adapter : Adapter, device : Device, config : SurfaceConfiguration) -> Boolfn Surface::configure_with_or_raise(self : Surface, adapter : Adapter, device : Device, config : SurfaceConfiguration) -> Unit raise SurfaceConfigureErrorfn Surface::get_capabilities(self : Surface, adapter : Adapter, capabilities : WGPUSurfaceCapabilitiesPtr) -> WGPUStatusfn Surface::get_current_texture_or_raise(self : Surface) -> SurfaceTexture raise SurfaceTextureErrorfn Surface::get_current_texture_raw(self : Surface, surface_texture : WGPUSurfaceTexturePtr) -> Unitfn Surface::sync_macos_ns_view_layer(self : Surface, ns_view : OpaquePtr) -> Unit raise SurfaceCreateErrorfn Surface::sync_macos_ns_view_layer_u64(self : Surface, ns_view : UInt64) -> Unit raise SurfaceCreateErrorfn Surface::sync_macos_window_handle(self : Surface, window_handle : WindowHandle) -> Unit raise SurfaceCreateErrorpub struct SurfaceConfiguration {
width : UInt
height : UInt
usage : TextureUsage
format : TextureFormat
present_mode_u32 : UInt
alpha_mode_u32 : UInt
view_formats : Array[TextureFormat]
desired_maximum_frame_latency : UInt
}fn SurfaceConfiguration::new(width : UInt, height : UInt, usage : TextureUsage, format : TextureFormat, present_mode : PresentMode, alpha_mode : CompositeAlphaMode) -> SurfaceConfigurationfn SurfaceConfiguration::with_desired_maximum_frame_latency(self : SurfaceConfiguration, desired_maximum_frame_latency : UInt) -> SurfaceConfigurationfn SurfaceConfiguration::with_view_formats(self : SurfaceConfiguration, view_formats : Array[TextureFormat]) -> SurfaceConfigurationfn SurfaceTexture::take_texture_or_raise(self : SurfaceTexture) -> Texture raise SurfaceTextureErrorfn Texture::create_view_2d(self : Texture, base_mip_level : UInt, mip_level_count : UInt) -> TextureViewfn Texture::create_view_2d_array(self : Texture, base_array_layer : UInt, array_layer_count : UInt, base_mip_level : UInt, mip_level_count : UInt) -> TextureViewfn Texture::create_view_ptr(self : Texture, descriptor : WGPUTextureViewDescriptorPtr) -> TextureViewfn Texture::create_view_raw(self : Texture, descriptor : WGPUTextureViewDescriptorPtr) -> TextureViewfn Texture::create_view_u32(self : Texture, format : TextureFormat, view_dimension_u32 : UInt, aspect_u32 : UInt, base_array_layer : UInt, array_layer_count : UInt, base_mip_level : UInt, mip_level_count : UInt) -> TextureViewpub struct TextureFormat {
raw : UInt
}impl Eq for TextureFormatlet COMPILATION_INFO_REQUEST_STATUS_CALLBACK_CANCELLED : UIntlet COMPUTE_PIPELINE_DESC_ERR_NULL_DESCRIPTOR : UIntlet CREATE_PIPELINE_ASYNC_STATUS_CALLBACK_CANCELLED : UIntlet CREATE_PIPELINE_ASYNC_STATUS_INTERNAL_ERROR : UIntlet CREATE_PIPELINE_ASYNC_STATUS_VALIDATION_ERROR : UIntlet FEATURES_EXPERIMENTAL_MESH_SHADER_POINTS : UInt64let FEATURE_NAME_TEXTURE_COMPRESSION_ASTC_SLICED3D : UIntlet FEATURE_NAME_TEXTURE_COMPRESSION_BC_SLICED3D : UIntlet INSTANCE_FEATURE_NAME_MULTIPLE_DEVICES_PER_ADAPTER : UIntlet INSTANCE_FEATURE_NAME_SHADER_SOURCE_SPIRV : UIntlet NATIVE_FEATURE_ACCELERATION_STRUCTURE_BINDING_ARRAY : UIntlet NATIVE_FEATURE_ADDRESS_MODE_CLAMP_TO_BORDER : UIntlet NATIVE_FEATURE_ADDRESS_MODE_CLAMP_TO_ZERO : UIntlet NATIVE_FEATURE_CONSERVATIVE_RASTERIZATION : UIntlet NATIVE_FEATURE_MEMORY_DECORATION_COHERENT : UIntlet NATIVE_FEATURE_MEMORY_DECORATION_VOLATILE : UIntlet NATIVE_FEATURE_PARTIALLY_BOUND_BINDING_ARRAY : UIntlet NATIVE_FEATURE_SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING : UIntlet NATIVE_FEATURE_SHADER_INT64_ATOMIC_ALL_OPS : UIntlet NATIVE_FEATURE_SHADER_INT64_ATOMIC_MIN_MAX : UIntlet NATIVE_FEATURE_STORAGE_RESOURCE_BINDING_ARRAY : UIntlet NATIVE_FEATURE_STORAGE_TEXTURE_ARRAY_NON_UNIFORM_INDEXING : UIntlet NATIVE_FEATURE_TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES : UIntlet NATIVE_FEATURE_TEXTURE_COMPRESSION_ASTC_HDR : UIntlet NATIVE_FEATURE_TIMESTAMP_QUERY_INSIDE_ENCODERS : UIntlet NATIVE_FEATURE_TIMESTAMP_QUERY_INSIDE_PASSES : UIntlet NATIVE_SURFACE_GET_CURRENT_TEXTURE_STATUS_FORCE32 : UIntlet OPTIONAL_SYMBOL_AVAILABILITY_MISSING_SYMBOL : UIntlet OPTIONAL_SYMBOL_AVAILABILITY_NATIVE_UNAVAILABLE : UIntlet OPTIONAL_SYMBOL_ERROR_KIND_MISSING_SYMBOL : UIntlet OPTIONAL_SYMBOL_ERROR_KIND_NATIVE_UNAVAILABLE : UIntlet OPTIONAL_SYMBOL_ERROR_KIND_RUNTIME_FAILED : UIntlet PIPELINE_STATISTIC_NAME_CLIPPER_INVOCATIONS : UIntlet PIPELINE_STATISTIC_NAME_CLIPPER_PRIMITIVES_OUT : UIntlet PIPELINE_STATISTIC_NAME_COMPUTE_SHADER_INVOCATIONS : UIntlet PIPELINE_STATISTIC_NAME_FRAGMENT_SHADER_INVOCATIONS : UIntlet PIPELINE_STATISTIC_NAME_VERTEX_SHADER_INVOCATIONS : UIntlet POP_ERROR_SCOPE_STATUS_CALLBACK_CANCELLED : UIntlet QUEUE_WORK_DONE_STATUS_CALLBACK_CANCELLED : UIntlet RENDER_PASS_DESC_ERR_COLOR_ATTACHMENT_INDEX_OOB : UIntlet RENDER_PIPELINE_DESC_ERR_COLOR_TARGET_COUNT_EXCEEDS_MAX : UIntlet RENDER_PIPELINE_DESC_ERR_COLOR_TARGET_COUNT_ZERO : UIntlet RENDER_PIPELINE_DESC_ERR_COLOR_TARGET_INDEX_OOB : UIntlet RENDER_PIPELINE_DESC_ERR_NO_VERTEX_BUFFER_LAYOUT : UIntlet RENDER_PIPELINE_DESC_ERR_VERTEX_ATTRIBUTE_EXCEEDS_MAX : UIntlet RENDER_PIPELINE_DESC_ERR_VERTEX_BUFFER_LAYOUT_EXCEEDS_MAX : UIntlet REQUEST_ADAPTER_STATUS_CALLBACK_CANCELLED : UIntlet SHADER_RUNTIME_CHECKS_FORCE_LOOP_BOUNDING : UInt64let SHADER_RUNTIME_CHECKS_MESH_SHADER_PRIMITIVE_INDICES_CLAMP : UInt64let SHADER_RUNTIME_CHECKS_RAY_QUERY_INITIALIZATION_TRACKING : UInt64let SHADER_RUNTIME_CHECKS_TASK_SHADER_DISPATCH_TRACKING : UInt64let SURFACE_CREATE_STATUS_CREATE_SURFACE_FAILED : UIntlet SURFACE_CREATE_STATUS_INVALID_METAL_LAYER : UIntlet SURFACE_CREATE_STATUS_METAL_LAYER_UNAVAILABLE : UIntlet SURFACE_CREATE_STATUS_UNSUPPORTED_PLATFORM : UIntlet SURFACE_DEFAULT_DESIRED_MAXIMUM_FRAME_LATENCY : UIntlet SURFACE_GET_CURRENT_TEXTURE_STATUS_DEVICE_LOST : UIntlet SURFACE_GET_CURRENT_TEXTURE_STATUS_FORCE32 : UIntlet SURFACE_GET_CURRENT_TEXTURE_STATUS_OCCLUDED : UIntlet SURFACE_GET_CURRENT_TEXTURE_STATUS_OUTDATED : UIntlet SURFACE_GET_CURRENT_TEXTURE_STATUS_OUT_OF_MEMORY : UIntlet SURFACE_GET_CURRENT_TEXTURE_STATUS_SUCCESS_OPTIMAL : UIntlet SURFACE_GET_CURRENT_TEXTURE_STATUS_SUCCESS_SUBOPTIMAL : UIntlet SURFACE_GET_CURRENT_TEXTURE_STATUS_TIMEOUT : UIntlet S_TYPE_SURFACE_SOURCE_ANDROID_NATIVE_WINDOW : UIntlet S_TYPE_TEXTURE_COMPONENT_SWIZZLE_DESCRIPTOR : UIntlet WGSL_LANGUAGE_FEATURE_NAME_LINEAR_INDEXING : UIntlet WGSL_LANGUAGE_FEATURE_NAME_PACKED4X8_INTEGER_DOT_PRODUCT : UIntlet WGSL_LANGUAGE_FEATURE_NAME_POINTER_COMPOSITE_ACCESS : UIntlet WGSL_LANGUAGE_FEATURE_NAME_READONLY_AND_READWRITE_STORAGE_TEXTURES : UIntlet WGSL_LANGUAGE_FEATURE_NAME_SUBGROUP_UNIFORMITY : UIntlet WGSL_LANGUAGE_FEATURE_NAME_TEXTURE_AND_SAMPLER_LET : UIntlet WGSL_LANGUAGE_FEATURE_NAME_TEXTURE_FORMATS_TIER1 : UIntlet WGSL_LANGUAGE_FEATURE_NAME_UNIFORM_BUFFER_STANDARD_LAYOUT : UIntlet WGSL_LANGUAGE_FEATURE_NAME_UNRESTRICTED_POINTER_PARAMETERS : UIntfn set_uncaptured_error_stderr_enabled(enabled : Bool) -> Unitfn surface_configuration_ptr_new(device : Device, config : SurfaceConfiguration) -> WGPUSurfaceConfigurationPtrfn surface_descriptor_wayland_new(display : OpaquePtr, surface : OpaquePtr) -> WGPUSurfaceDescriptorPtrfn surface_descriptor_windows_hwnd_new(hinstance : OpaquePtr, hwnd : OpaquePtr) -> WGPUSurfaceDescriptorPtrfn with_default_device_queue_auto_release(run : (Instance, Device, Queue, AutoReleasePool) -> Unit raise) -> Unit raisefn with_default_device_queue_managed(run : (Instance, ManagedDevice, ManagedQueue) -> Unit raise) -> Unit raiseThis repo contains a MoonBit port of the `wgpu-native` C API (WebGPU)
Dependencies