laplaceliu/tycho_webgpu/types does not have a README file

    WgpuError

    pub(all) suberror WgpuError {
    InitFailed(String)
    DeviceFailed(String)
    ShaderFailed(String)
    PipelineFailed(String)
    TextureFailed(String)
    BufferFailed(String)
    CommandFailed(String)
    ReadbackFailed(String)
    InvalidArgument(String)
    }

    Errors reported by the WebGPU binding layer.
    impl Show for WgpuError

    AddressMode

    pub(all) enum AddressMode {
    Repeat
    ClampToEdge
    } derive(Eq,
    Debug
    )

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

    AddressMode::code

    fn AddressMode::code(self : AddressMode) -> Int

    AddressMode::wgpu_name

    fn AddressMode::wgpu_name(self : AddressMode) -> String

    BlendFactor

    pub(all) enum BlendFactor {
    Zero
    One
    SrcColor
    OneMinusSrcColor
    DstColor
    OneMinusDstColor
    SrcAlpha
    OneMinusSrcAlpha
    DstAlpha
    OneMinusDstAlpha
    } derive(Eq,
    Debug
    )

    BlendFactor::wgpu_name

    fn BlendFactor::wgpu_name(self : BlendFactor) -> String

    BlendOp

    pub(all) enum BlendOp {
    Add
    Subtract
    ReverseSubtract
    Min
    Max
    } derive(Eq,
    Debug
    )

    BlendOp::wgpu_name

    fn BlendOp::wgpu_name(self : BlendOp) -> String

    BlendState

    pub(all) struct BlendState {
    src_color : BlendFactor
    dst_color : BlendFactor
    color_op : BlendOp
    src_alpha : BlendFactor
    dst_alpha : BlendFactor
    alpha_op : BlendOp
    }

    BufferUsage

    pub(all) struct BufferUsage {
    // private fields
    } derive(Eq,
    Debug
    )

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

    BufferUsage::bits

    fn BufferUsage::bits(self : BufferUsage) -> Int

    BufferUsage::combine

    fn BufferUsage::combine(self : BufferUsage, other : BufferUsage) -> BufferUsage

    BufferUsage::contains

    fn BufferUsage::contains(self : BufferUsage, other : BufferUsage) -> Bool

    BufferUsage::copy_dst

    fn BufferUsage::copy_dst() -> BufferUsage

    BufferUsage::copy_src

    fn BufferUsage::copy_src() -> BufferUsage

    BufferUsage::index

    fn BufferUsage::index() -> BufferUsage

    BufferUsage::indirect

    fn BufferUsage::indirect() -> BufferUsage

    BufferUsage::js_bits

    fn BufferUsage::js_bits(self : BufferUsage) -> Int

    Converts to the standard WebGPU GPUBufferUsage bitmask (0x04..0x100).

    BufferUsage::none

    fn BufferUsage::none() -> BufferUsage

    BufferUsage::storage

    fn BufferUsage::storage() -> BufferUsage

    BufferUsage::uniform

    fn BufferUsage::uniform() -> BufferUsage

    BufferUsage::vertex

    fn BufferUsage::vertex() -> BufferUsage

    CompareOp

    pub(all) enum CompareOp {
    Never
    Less
    Equal
    LessEqual
    Greater
    NotEqual
    GreaterEqual
    Always
    } derive(Eq,
    Debug
    )

    CompareOp::code

    fn CompareOp::code(self : CompareOp) -> Int

    CompareOp::wgpu_name

    fn CompareOp::wgpu_name(self : CompareOp) -> String

    CullMode

    pub(all) enum CullMode {
    None
    Front
    Back
    } derive(Eq,
    Debug
    )

    CullMode::wgpu_name

    fn CullMode::wgpu_name(self : CullMode) -> String

    DepthStencilState

    pub(all) struct DepthStencilState {
    format : TextureFormat
    depth_write : Bool
    depth_compare : CompareOp
    stencil : StencilState?
    depth_bias : Int
    depth_bias_slope : Double
    }

    Filter

    pub(all) enum Filter {
    Nearest
    Linear
    } derive(Eq,
    Debug
    )

    Filter::code

    fn Filter::code(self : Filter) -> Int

    Filter::wgpu_name

    fn Filter::wgpu_name(self : Filter) -> String

    FrontFace

    pub(all) enum FrontFace {
    CounterClockwise
    Clockwise
    } derive(Eq,
    Debug
    )

    FrontFace::wgpu_name

    fn FrontFace::wgpu_name(self : FrontFace) -> String

    IndexFormat

    pub(all) enum IndexFormat {
    Uint16
    Uint32
    } derive(Eq,
    Debug
    )

    Index buffer element width.

    IndexFormat::code

    fn IndexFormat::code(self : IndexFormat) -> Int

    IndexFormat::wgpu_name

    fn IndexFormat::wgpu_name(self : IndexFormat) -> String

    LoadOp

    pub(all) enum LoadOp {
    Clear
    Load
    } derive(Eq,
    Debug
    )

    LoadOp::code

    fn LoadOp::code(self : LoadOp) -> Int

    LoadOp::wgpu_name

    fn LoadOp::wgpu_name(self : LoadOp) -> String

    Platform

    pub(all) enum Platform {
    Linux
    Windows
    MacOS
    } derive(Eq,
    Debug
    )

    Platform::code

    fn Platform::code(self : Platform) -> Int

    PresentMode

    pub(all) enum PresentMode {
    Fifo
    Mailbox
    Immediate
    } derive(Eq,
    Debug
    )

    PresentMode::code

    fn PresentMode::code(self : PresentMode) -> Int

    SamplerDesc

    pub(all) struct SamplerDesc {
    mag : Filter
    min : Filter
    mipmap : Filter
    address : AddressMode
    min_lod : Float
    max_lod : Float
    anisotropy : Float
    compare : CompareOp?
    }

    SamplerDesc::new

    fn SamplerDesc::new(mag? : Filter, min? : Filter, mipmap? : Filter, address? : AddressMode, min_lod? : Float, max_lod? : Float, anisotropy? : Float, compare? : CompareOp) -> SamplerDesc

    StencilFaceState

    pub(all) struct StencilFaceState {
    compare : CompareOp
    fail_op : StencilOp
    depth_fail_op : StencilOp
    pass_op : StencilOp
    }

    StencilOp

    pub(all) enum StencilOp {
    Keep
    Zero
    Replace
    IncrementAndClamp
    DecrementAndClamp
    Invert
    IncrementAndWrap
    DecrementAndWrap
    } derive(Eq,
    Debug
    )

    StencilOp::wgpu_name

    fn StencilOp::wgpu_name(self : StencilOp) -> String

    StencilState

    pub(all) struct StencilState {
    front : StencilFaceState
    back : StencilFaceState
    read_mask : UInt
    write_mask : UInt
    }

    StepMode

    pub(all) enum StepMode {
    Vertex
    Instance
    } derive(Eq,
    Debug
    )

    StepMode::code

    fn StepMode::code(self : StepMode) -> Int

    StepMode::wgpu_name

    fn StepMode::wgpu_name(self : StepMode) -> String

    StoreOp

    pub(all) enum StoreOp {
    Store
    Discard
    } derive(Eq,
    Debug
    )

    StoreOp::code

    fn StoreOp::code(self : StoreOp) -> Int

    StoreOp::wgpu_name

    fn StoreOp::wgpu_name(self : StoreOp) -> String

    TextureFormat

    pub(all) enum TextureFormat {
    RGBA8
    BGRA8
    RGBA8Srgb
    BGRA8Srgb
    RGBA16F
    RG16F
    R8
    RGBA32F
    Depth32F
    Depth24Stencil8
    } derive(Eq,
    Debug
    )

    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.

    TextureFormat::code

    fn TextureFormat::code(self : TextureFormat) -> Int

    TextureFormat::from_code

    fn TextureFormat::from_code(code : Int) -> TextureFormat

    TextureFormat::from_wgpu_name

    fn TextureFormat::from_wgpu_name(name : String) -> TextureFormat

    TextureFormat::is_depth

    fn TextureFormat::is_depth(self : TextureFormat) -> Bool

    TextureFormat::supports_storage_binding

    fn TextureFormat::supports_storage_binding(self : TextureFormat) -> Bool

    Whether WebGPU allows STORAGE_BINDING usage on this texture format.

    TextureFormat::texel_bytes

    fn TextureFormat::texel_bytes(self : TextureFormat) -> Int

    TextureFormat::wgpu_name

    fn TextureFormat::wgpu_name(self : TextureFormat) -> String

    TextureUsage

    pub(all) struct TextureUsage {
    // private fields
    } derive(Eq,
    Debug
    )

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

    TextureUsage::bits

    fn TextureUsage::bits(self : TextureUsage) -> Int

    TextureUsage::combine

    fn TextureUsage::combine(self : TextureUsage, other : TextureUsage) -> TextureUsage

    TextureUsage::contains

    fn TextureUsage::contains(self : TextureUsage, other : TextureUsage) -> Bool

    TextureUsage::copy_dst

    fn TextureUsage::copy_dst() -> TextureUsage

    TextureUsage::copy_src

    fn TextureUsage::copy_src() -> TextureUsage

    TextureUsage::js_bits

    fn TextureUsage::js_bits(self : TextureUsage) -> Int

    Converts to the standard WebGPU GPUTextureUsage bitmask (0x01..0x10).

    TextureUsage::none

    TextureUsage::render_attachment

    fn TextureUsage::render_attachment() -> TextureUsage

    TextureUsage::sampled

    fn TextureUsage::sampled() -> TextureUsage

    TextureUsage::storage

    fn TextureUsage::storage() -> TextureUsage

    Topology

    pub(all) enum Topology {
    TriangleList
    TriangleStrip
    LineList
    LineStrip
    PointList
    } derive(Eq,
    Debug
    )

    Topology::code

    fn Topology::code(self : Topology) -> Int

    Topology::wgpu_name

    fn Topology::wgpu_name(self : Topology) -> String

    VertexAttribute

    pub(all) struct VertexAttribute {
    location : Int
    format : VertexFormat
    offset : Int
    }

    VertexAttribute::new

    fn VertexAttribute::new(location : Int, format : VertexFormat, offset : Int) -> VertexAttribute

    VertexBufferLayout

    pub(all) struct VertexBufferLayout {
    stride : Int
    step_mode : StepMode
    attributes : Array[VertexAttribute]
    }

    VertexBufferLayout::new

    fn VertexBufferLayout::new(stride : Int, attributes : Array[VertexAttribute], step_mode? : StepMode) -> VertexBufferLayout

    VertexFormat

    pub(all) enum VertexFormat {
    Float2
    Float3
    Float4
    Float1
    Int1
    Uint1
    Unorm8x4
    Uint16x4
    } derive(Eq,
    Debug
    )

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

    VertexFormat::code

    fn VertexFormat::code(self : VertexFormat) -> Int

    VertexFormat::wgpu_name

    fn VertexFormat::wgpu_name(self : VertexFormat) -> String

    is_spirv_words

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

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

    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