Crate core

Source
Expand description

This library safely implements WebGPU on native platforms. It is designed for integration into browsers, as well as wrapping into other language-specific user-friendly libraries.

§Feature flags

  • api_log_info — Log all API entry points at info instead of trace level.

  • resource_log_info — Log resource lifecycle management at info instead of trace level.

  • link (enabled by default) — Use static linking for libraries. Disale to manually link. Enabled by default.

  • renderdoc — Support the Renderdoc graphics debugger: https://renderdoc.org/

  • strict_asserts — Apply run-time checks, even in release builds. These are in addition to the validation carried out at public APIs in all builds.

  • trace — Enable API tracing.

  • replay — Enable API replaying

  • serial-pass — Enable serializable compute/render passes, and bundle encoders.

  • wgsl — Enable ShaderModuleSource::Wgsl

  • fragile-send-sync-non-atomic-wasm — Implement Send and Sync on Wasm, but only if atomics are not enabled.

    WebGL/WebGPU objects can not be shared between threads. However, it can be useful to artificially mark them as Send and Sync anyways to make it easier to write cross-platform code. This is technically very unsafe in a multithreaded environment, but on a wasm binary compiled without atomics we know we are definitely not in a multithreaded environment.

§Backends, passed through to wgpu-hal

  • metal — Enable the metal backend.

  • vulkan — Enable the vulkan backend.

  • gles — Enable the GLES backend.

    This is used for all of GLES, OpenGL, and WebGL.

  • dx12 — Enable the dx12 backend.

Modules§

any_surface
api
binding_model
command
device
error
global
hal_api
hub
Allocating resource ids, and tracking the resources they refer to.
id
identity
instance
naga
Universal shader translator.
pipeline
present
Presentation.
registry
resource
storage
validation

Macros§

gfx_if_dx12
gfx_if_dx12_hidden
gfx_if_empty
gfx_if_empty_hidden
gfx_if_gles
gfx_if_gles_hidden
gfx_if_metal
gfx_if_metal_hidden
gfx_if_vulkan
gfx_if_vulkan_hidden
gfx_select
Dispatch on an Id’s backend to a backend-generic method.

Constants§

MAX_BIND_GROUPS
MAX_COLOR_ATTACHMENTS
MAX_VERTEX_BUFFERS

Functions§

hal_label

Type Aliases§

Label
RawString