laplaceliu/tycho_webgpu/native does not have a README file

    AddressMode

    WebGPU has no border address mode; callers decide whether to reject ClampToBorder or clamp to edge.

    BufferUsage

    Composable buffer usage flags; bits() is the contract with wgpu_stub.c, while js_bits() produces standard WebGPU GPUBufferUsage bitmasks.

    IndexFormat

    Index buffer element width.

    TextureFormat

    TextureFormat ordinals. The integer code() values match the encoding wgpu_stub.c maps to WGPUTextureFormat; wgpu_name() yields the exact WebGPU string token used by browser navigator.gpu.

    TextureUsage

    Composable texture usage flags; bits() is the contract with wgpu_stub.c, while js_bits() produces standard WebGPU GPUTextureUsage bitmasks.

    VertexFormat

    Vertex attribute formats. The ordinals match wgpu_stub.c; wgpu_name() matches the WebGPU JS specification.

    WgpuError

    Errors reported by the WebGPU binding layer.

    BindEntry

    pub(all) enum BindEntry {
    Uniform(Int, Buffer, Int, Int)
    Texture(Int, Texture)
    Sampler(Int, Sampler)
    }

    BindEntry::sampler

    fn BindEntry::sampler(binding : Int, sampler : Sampler) -> BindEntry

    BindEntry::texture

    fn BindEntry::texture(binding : Int, texture : Texture) -> BindEntry

    BindEntry::uniform

    fn BindEntry::uniform(binding : Int, buffer : Buffer, offset? : Int, size? : Int) -> BindEntry

    BindGroup

    pub struct BindGroup {
    // private fields
    }

    BindGroup::destroy

    fn BindGroup::destroy(self : BindGroup) -> Unit

    Buffer

    pub struct Buffer {
    // private fields
    }

    Buffer::destroy

    fn Buffer::destroy(self : Buffer) -> Unit

    Buffer::size

    fn Buffer::size(self : Buffer) -> Int

    Buffer::write

    fn Buffer::write(self : Buffer, data : Bytes, offset? : Int) -> Unit raise
    WgpuError

    Buffer::write_floats

    fn Buffer::write_floats(self : Buffer, data : FixedArray[Float], offset? : Int) -> Unit raise
    WgpuError

    CommandList

    pub struct CommandList {
    // private fields
    }

    CommandList::begin_pass

    fn CommandList::begin_pass(self : CommandList, target : Texture, load_op? :
    LoadOp
    , r? : Double, g? : Double, b? : Double, a? : Double, depth? : Texture?, depth_load_op? :
    LoadOp
    , depth_clear? : Double, resolve? : Texture?) -> Unit raise
    WgpuError

    CommandList::destroy

    fn CommandList::destroy(self : CommandList) -> Unit

    CommandList::draw

    fn CommandList::draw(self : CommandList, vertices : Int, instances? : Int) -> Unit

    CommandList::draw_indexed

    fn CommandList::draw_indexed(self : CommandList, index_count : Int, instances? : Int, first_index? : Int, base_vertex? : Int, first_instance? : Int) -> Unit

    CommandList::end_pass

    CommandList::set_bind_group

    fn CommandList::set_bind_group(self : CommandList, index : Int, group : BindGroup) -> Unit raise
    WgpuError

    CommandList::set_index

    fn CommandList::set_index(self : CommandList, buffer : Buffer, format :
    IndexFormat
    , offset? : Int, size? : Int) -> Unit raise
    WgpuError

    CommandList::set_pipeline

    fn CommandList::set_pipeline(self : CommandList, pipeline : Pipeline) -> Unit

    CommandList::set_vertex

    fn CommandList::set_vertex(self : CommandList, slot : Int, buffer : Buffer, offset? : Int) -> Unit raise
    WgpuError

    Device

    pub struct Device {
    // private fields
    }

    Device::adapter_name

    fn Device::adapter_name(self : Device) -> String

    Device::backend_type

    fn Device::backend_type(self : Device) -> Int

    Device::create

    fn Device::create(app_name : String, validation? : Bool) -> Device raise
    WgpuError

    Device::create_command_list

    Device::create_render_pipeline

    fn Device::create_render_pipeline(self : Device, vs : Shader, fs : Shader?, vs_entry? : String, fs_entry? : String, format? :
    TextureFormat
    , topology? :
    Topology
    , vertex_layouts? : Array[
    VertexBufferLayout
    ], samples? : Int, depth_format? :
    TextureFormat
    ?, depth_write? : Bool, depth_compare? :
    CompareOp
    , depth_bias? : Int, depth_bias_slope? : Double) -> Pipeline raise
    WgpuError

    Device::create_shader

    fn Device::create_shader(self : Device, wgsl : String) -> Shader raise
    WgpuError

    Device::create_shader_from_words

    fn Device::create_shader_from_words(self : Device, words : FixedArray[UInt]) -> Shader raise
    WgpuError

    Device::create_texture

    Device::create_texture_with_data

    Device::destroy

    fn Device::destroy(self : Device) -> Unit

    Device::is_lost

    fn Device::is_lost(self : Device) -> Bool

    Device::max_texture_dimension_2d

    fn Device::max_texture_dimension_2d(self : Device) -> Int

    Device::min_uniform_buffer_offset_alignment

    fn Device::min_uniform_buffer_offset_alignment(self : Device) -> Int

    Device::submit

    Device::validation_errors

    fn Device::validation_errors(self : Device) -> Int

    Device::wait_idle

    fn Device::wait_idle(self : Device) -> Bool

    Pipeline

    pub struct Pipeline {
    // private fields
    }

    Pipeline::create_bind_group

    Pipeline::destroy

    fn Pipeline::destroy(self : Pipeline) -> Unit

    Sampler

    pub struct Sampler {
    // private fields
    }

    Sampler::destroy

    fn Sampler::destroy(self : Sampler) -> Unit

    Shader

    pub struct Shader {
    // private fields
    }

    Shader::destroy

    fn Shader::destroy(self : Shader) -> Unit

    Surface

    pub struct Surface {
    // private fields
    }

    Surface::acquire

    Surface::configure

    fn Surface::configure(self : Surface, device : Device, width : Int, height : Int, format :
    TextureFormat
    , present_mode? :
    PresentMode
    , copy_src? : Bool) -> Unit raise
    WgpuError

    Surface::create

    fn Surface::create(device : Device, platform :
    Platform
    , is_wayland : Bool, display : UInt64, handle : UInt64) -> Surface raise
    WgpuError

    Surface::destroy

    fn Surface::destroy(self : Surface) -> Unit

    Surface::present

    Texture

    pub struct Texture {
    // private fields
    }

    Texture::destroy

    fn Texture::destroy(self : Texture) -> Unit

    Texture::height

    fn Texture::height(self : Texture) -> Int

    Texture::readback

    fn Texture::readback(self : Texture, device : Device) -> Bytes raise
    WgpuError

    Texture::width

    fn Texture::width(self : Texture) -> Int

    available

    fn available() -> Bool

    is_spirv_words

    fn is_spirv_words(words : FixedArray[UInt]) -> Bool

    Returns true when words starts with the SPIR-V magic number 0x07230203.

    last_error

    fn last_error() -> String

    wgsl_from_words

    fn wgsl_from_words(words : FixedArray[UInt]) -> String

    Unpacks a little-endian zero-padded FixedArray[UInt32] WGSL blob back to UTF-8 text. Works identically on both native and js targets.

    wgsl_words

    fn wgsl_words(source : String) -> FixedArray[UInt]

    Packs WGSL UTF-8 source text into a FixedArray[UInt32] blob (little-endian words, zero-padded to a 4-byte boundary) so WGSL rides the same shader word channel as SPIR-V and DXIL.

    Source Files