Crate wgpu_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

See documentation for the wgpu crate for more in-depth information on these features.

§Logging Configuration

  • api_log_info — Log all API entry points at info instead of trace level. Also, promotes certain debug log calls to info.
  • resource_log_info — Log resource lifecycle management at info instead of trace level.

§Runtime Checks

  • 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.

§Debugging

  • observe_locks — Enable lock order observation.

§Serialization

  • serde — Enables serialization via serde on common wgpu types.
  • trace — Enable API tracing.
  • replay — Enable API replaying

§Surface Support

  • raw-window-handle — Enable creating surfaces using raw-window-handle

§Shading Language Support

  • wgsl — Enable ShaderModuleSource::Wgsl
  • glsl — Enable ShaderModuleSource::Glsl
  • spirv — Enable ShaderModuleSource::SpirV

§Other

  • counters — Internally count resources and events for debugging purposes. If the counters feature is disabled, the counting infrastructure is removed from the build and the exposed counters always return 0.
  • fragile-send-sync-non-atomic-wasm — Implement Send and Sync on Wasm, but only if atomics are not enabled.
  • std (enabled by default) — Enable certain items to be Send and Sync when they would not otherwise be. Also enables backtraces in some error cases when also under cfg(debug_assertions).

§External libraries

The following features facilitate integration with third-party supporting libraries.

  • static-dxc — Enable using the mach-dxcompiler-rs crate to compile DX12 shaders.
  • portable-atomic — Enable portable atomics on platforms that do not support 64bit atomics.

§Target Conditional Features

  • dx12 — DX12 backend
  • metal — Metal backend
  • vulkan — Vulkan backend, only available on Windows, Linux, Android
  • gles — OpenGL backend, only available on Windows, Linux, Android, and Emscripten
  • webgl — WebGL backend, only available on Emscripten
  • angle — OpenGL backend, on macOS only
  • vulkan-portability — Vulkan portability backend, only available on macOS
  • renderdoc — Renderdoc integration, only available on Windows, Linux, and Android
  • noop — Enable the noop backend.

Re-exports§

pub use validation::map_storage_format_from_naga;
pub use validation::map_storage_format_to_naga;
pub use naga;

Modules§

api
as_hal 🔒
binding_model
command
conv 🔒
device
error
global
hash_utils 🔒
Module for hashing utilities.
hub
Allocating resource ids, and tracking the resources they refer to.
id
identity
indirect_validation 🔒
init_tracker 🔒
Lazy initialization of texture and buffer memory.
instance
lock 🔒
Instrumented lock types.
pipeline
pipeline_cache 🔒
pool 🔒
present
Presentation.
ray_tracing
registry
resource
scratch 🔒
snatch 🔒
storage
timestamp_normalization 🔒
Utility for normalizing GPU timestamp queries to have a consistent 1GHz period. This uses a compute shader to do the normalization, so the timestamps exist in their correct format on the GPU, as is required by the WebGPU specification.
track 🔒
Resource State and Lifetime Trackers
validation
weak_vec 🔒
Module containing the WeakVec API.

Macros§

api_log 🔒 Non-api_log_info
api_log_debug 🔒 Non-api_log_info
impl_labeled
impl_parent_device
impl_resource_type
impl_storage_item
impl_trackable
resource_log 🔒 Non-resource_log_info

Constants§

DOWNLEVEL_ERROR_MESSAGE 🔒
DOWNLEVEL_WARNING_MESSAGE 🔒
MAX_BIND_GROUPS
MAX_COLOR_ATTACHMENTS
MAX_VERTEX_BUFFERS

Traits§

LabelHelpers 🔒

Functions§

get_greatest_common_divisor 🔒
get_lowest_common_denom 🔒
hal_label

Type Aliases§

Epoch 🔒
Index 🔒
Label
RawString
SubmissionIndex
The index of a queue submission.