browser

package
v0.30.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressModeToJS

func AddressModeToJS(m gputypes.AddressMode) string

AddressModeToJS converts a gputypes.AddressMode to JS string.

func BlendFactorToJS

func BlendFactorToJS(f gputypes.BlendFactor) string

BlendFactorToJS converts a gputypes.BlendFactor to JS string.

func BlendOperationToJS

func BlendOperationToJS(op gputypes.BlendOperation) string

BlendOperationToJS converts a gputypes.BlendOperation to JS string.

func BufferBindingTypeToJS

func BufferBindingTypeToJS(t gputypes.BufferBindingType) string

BufferBindingTypeToJS converts a gputypes.BufferBindingType to JS string.

func CompareFunctionToJS

func CompareFunctionToJS(f gputypes.CompareFunction) string

CompareFunctionToJS converts a gputypes.CompareFunction to JS string.

func CompositeAlphaModeToJS

func CompositeAlphaModeToJS(mode gputypes.CompositeAlphaMode) string

CompositeAlphaModeToJS converts a gputypes.CompositeAlphaMode to the WebGPU JS canvas alpha mode string.

Browser WebGPU only supports "opaque" and "premultiplied". PostMultiplied and Inherit are not valid on the web (Rust wgpu panics on those). Auto and Opaque both map to "opaque".

See: https://www.w3.org/TR/webgpu/#enumdef-gpucanvasalphamode

func CullModeToJS

func CullModeToJS(m gputypes.CullMode) string

CullModeToJS converts a gputypes.CullMode to JS string.

func FilterModeToJS

func FilterModeToJS(m gputypes.FilterMode) string

FilterModeToJS converts a gputypes.FilterMode to JS string.

func FrontFaceToJS

func FrontFaceToJS(f gputypes.FrontFace) string

FrontFaceToJS converts a gputypes.FrontFace to JS string.

func IndexFormatToJS

func IndexFormatToJS(f gputypes.IndexFormat) string

IndexFormatToJS converts a gputypes.IndexFormat to JS string.

func LoadOpToJS

func LoadOpToJS(op gputypes.LoadOp) string

LoadOpToJS converts a gputypes.LoadOp to the WebGPU JS string. Returns "load" for LoadOpLoad, "clear" for LoadOpClear, and "load" as default.

func PresentModeToJS

func PresentModeToJS(mode gputypes.PresentMode) string

PresentModeToJS converts a gputypes.PresentMode to the WebGPU JS present mode string.

Browser WebGPU does not expose present mode control; the browser always uses FIFO (VSync). Rust wgpu panics on Mailbox/Immediate on the web. We return "fifo" for all modes since the browser ignores it anyway.

func PrimitiveTopologyToJS

func PrimitiveTopologyToJS(t gputypes.PrimitiveTopology) string

PrimitiveTopologyToJS converts a gputypes.PrimitiveTopology to JS string.

func SamplerBindingTypeToJS

func SamplerBindingTypeToJS(t gputypes.SamplerBindingType) string

SamplerBindingTypeToJS converts a gputypes.SamplerBindingType to JS string.

func StencilOperationToJS

func StencilOperationToJS(op gputypes.StencilOperation) string

StencilOperationToJS converts a gputypes.StencilOperation to JS string.

func StorageTextureAccessToJS

func StorageTextureAccessToJS(a gputypes.StorageTextureAccess) string

StorageTextureAccessToJS converts a gputypes.StorageTextureAccess to JS string.

func StoreOpToJS

func StoreOpToJS(op gputypes.StoreOp) string

StoreOpToJS converts a gputypes.StoreOp to the WebGPU JS string. Returns "store" for StoreOpStore, "discard" for StoreOpDiscard, and "store" as default.

func TextureAspectToJS

func TextureAspectToJS(a gputypes.TextureAspect) string

TextureAspectToJS converts a gputypes.TextureAspect to JS string.

func TextureDimensionToJS

func TextureDimensionToJS(d gputypes.TextureDimension) string

TextureDimensionToJS converts a gputypes.TextureDimension to the WebGPU JS string.

func TextureFormatFromJS

func TextureFormatFromJS(s string) gputypes.TextureFormat

TextureFormatFromJS converts a WebGPU JS texture format string to the corresponding gputypes.TextureFormat. Returns TextureFormatUndefined if the string is not recognized.

This is the reverse of TextureFormatToJS and is needed for parsing the preferred canvas format returned by navigator.gpu.getPreferredCanvasFormat().

func TextureFormatToJS

func TextureFormatToJS(f gputypes.TextureFormat) string

TextureFormatToJS converts a gputypes.TextureFormat to the WebGPU JS string. Returns "" for TextureFormatUndefined.

func TextureSampleTypeToJS

func TextureSampleTypeToJS(t gputypes.TextureSampleType) string

TextureSampleTypeToJS converts a gputypes.TextureSampleType to JS string.

func TextureViewDimensionToJS

func TextureViewDimensionToJS(d gputypes.TextureViewDimension) string

TextureViewDimensionToJS converts a gputypes.TextureViewDimension to JS string.

func VertexFormatToJS

func VertexFormatToJS(f gputypes.VertexFormat) string

VertexFormatToJS converts a gputypes.VertexFormat to JS string.

func VertexStepModeToJS

func VertexStepModeToJS(m gputypes.VertexStepMode) string

VertexStepModeToJS converts a gputypes.VertexStepMode to JS string.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL