Crate web_glitz[−][src]
Expand description
WebGlitz is a low level graphics framework for the web build on top of WebGL 2 through wasm-bindgen. It intends to be easier to use by providing a more declarative interface (as opposed to WebGL’s procedural and stateful interface) that is memory safe and does not expose undefined behaviour.
Execution model
WebGlitz uses a stateless computation-as-data model, where rather than calling functions that directly cause an effect, you instead construct “task” values. Only when this task is submitted will it produce its effects. See the documentation for the task module for details on how tasks are constructed by combining commands and on how tasks are submitted to a runtime.
Runtimes
WebGlitz currently only implements a single threaded runtime, see runtime::single_threaded. With this runtime, tasks may only be submitted from the same thread as the thread in which the runtime was initialized. Submitting a task to the single threaded runtime typically does not result in dynamic dispatch (unless the task involves waiting on a GPU fence), which should mostly make the task model a zero/low cost abstraction when used with this runtime.
The task model should also make is possible to implement a thread-safe runtime, where tasks may also be submitted from other threads/(web-)workers. This is not yet implemented pending further details on WASM threads/workers and their implementation in wasm-bindgen. Submitting a task to this runtime will always involve dynamic dispatch, which may impose a (slight) performance cost on a task. However, it may also allow you to spread the work involved in task construction across multiple threads. How this trade-off impacts overall performance will depend on your application.
Modules
GPU-accessible memory buffers that contain typed data.
Extended functionality that may not be available in all contexts.
This module provides data types and traits for the allocation and manipulation of GPU-accessible image data.
Pipelines represent GPU configurations for parallel data processing.
Provides rendering contexts that act as the main point of interaction with the GPU.
Provides a framework for specifying units of work that are to be executed by the GPU driver.
Structs
Placeholder type for builders to mark unspecified or not yet specified attributes.