Module util

Source
Expand description

Utility structures and functions that are built on top of the main wgpu API.

Nothing in this module is a part of the WebGPU API specification; they are unique to the wgpu library.

ModulesΒ§

belt πŸ”’
device πŸ”’
encoder πŸ”’
init πŸ”’
mutex πŸ”’
Provides a Mutex for internal use based on what features are available.
texture_blitter πŸ”’

StructsΒ§

BufferInitDescriptor
Describes a Buffer when allocating.
DispatchIndirectArgs
Argument buffer layout for dispatch_indirect commands.
DownloadBuffer
CPU accessible buffer used to download data back from the GPU.
DrawIndexedIndirectArgs
Argument buffer layout for draw_indexed_indirect commands.
DrawIndirectArgs
Argument buffer layout for draw_indirect commands.
StagingBelt
Efficiently performs many buffer writes by sharing and reusing temporary buffers.
TextureBlitter
Texture Blitting (Copying) Utility
TextureBlitterBuilder
A builder for the TextureBlitter utility. If you want the default TextureBlitter use TextureBlitter::new instead.

EnumsΒ§

TextureDataOrder
Order in which texture data is laid out in memory.

ConstantsΒ§

SPIRV_MAGIC_NUMBER πŸ”’

TraitsΒ§

DeviceExt
Utility methods not meant to be in the main API.
RenderEncoder
Methods shared by RenderPass and RenderBundleEncoder.
TextureFormatExt
Adds extra conversion functions to TextureFormat.

FunctionsΒ§

align_to
Aligns a value to an alignment.
check_spirv_len πŸ”’
initialize_adapter_from_env
Initialize the adapter obeying the WGPU_ADAPTER_NAME environment variable.
initialize_adapter_from_env_or_default
Initialize the adapter obeying the WGPU_ADAPTER_NAME environment variable and if it doesn’t exist fall back on a default adapter.
is_browser_webgpu_supported
Determines whether the Backends::BROWSER_WEBGPU backend is supported.
make_spirv_raw
Version of make_spirv intended for use with Device::create_shader_module_passthrough. Returns a raw slice instead of ShaderSource.
new_instance_with_webgpu_detection
Create an new instance of wgpu, but disabling Backends::BROWSER_WEBGPU if no WebGPU support was detected.
pipeline_cache_key
A recommended key for storing PipelineCaches for the adapter associated with the given AdapterInfo This key will define a class of adapters for which the same cache might be valid.
verify_spirv_magic πŸ”’