Skip to main content

Module convert

Module convert 

Source
Expand description

Conversions between wgpu’s vocabulary and wasi:webgpu’s.

Every conversion is total: a wgpu value without a wasi counterpart panics naming the gap (the list is in the crate documentation); nothing is silently substituted. The wasi records spell out every optional member the WebGPU dictionaries default, so the host never fills in a default wgpu did not ask for.

Structs§

AttachmentOps
An attachment’s operations as WebGPU states them: a load op plus the value a clear uses.

Functions§

adapter_info_from_wasi
The wasi info is strings where wgpu has PCI ids: the description becomes the name and the rest lands in driver_info. The backend is reported as WebGPU, the API this is.
address_mode_to_wasi
alpha_mode_to_wasi
How the canvas blends its picture: Auto is WebGPU’s default, opaque, as wgpu’s browser backend takes it.
bind_group_layout_entry_to_wasi
blend_component_to_wasi
blend_factor_to_wasi
blend_operation_to_wasi
blend_state_to_wasi
buffer_binding_type_to_wasi
buffer_usages_from_wasi
buffer_usages_to_wasi
color_space_to_wasi
The canvas’s colour space and tone mapping for space: Auto and Srgb leave WebGPU’s defaults, an sRGB canvas with standard tone mapping; an extended space is its colour space with extended tone mapping, as wgpu’s browser backend sets it.
color_target_to_wasi
color_to_wasi
color_writes_to_wasi
The WIT gives all its own bit next to the four channels; it is set alongside them when every channel is written, so either reading of the flags sees the same mask.
compare_function_to_wasi
compilation_info_from_wasi
compilation_message_from_wasi
Locations are passed through as the host reports them; a message without a span (offset and length both zero) has none.
cull_mode_to_wasi
depth_stencil_state_to_wasi
device_lost_reason_from_wasi
error_filter_to_wasi
error_from_wasi
extent_to_wasi
features_from_wasi
features_to_wasi
The WIT names of required, or the features wasi:webgpu has no name for.
filter_mode_to_wasi
front_face_to_wasi
index_format_to_wasi
label
A wgpu label as the WIT carries it.
limits_from_wasi
wgpu limits with no WebGPU counterpart (binding arrays, mesh shaders, ray tracing, multiview) stay at wgpu’s defaults.
limits_to_wasi
The requested limits under their GPUSupportedLimits member names. Limits wgpu has and WebGPU does not are not requestable and are left out.
map_mode_to_wasi
mipmap_filter_mode_to_wasi
multisample_state_to_wasi
operations_to_wasi
LoadOp::DontCare leaves the contents undefined, which WebGPU cannot say; it clears to undefined_value, as wgpu’s web backend does.
origin_to_wasi
power_preference_to_wasi
primitive_state_to_wasi
primitive_topology_to_wasi
sampler_binding_type_to_wasi
sampler_descriptor_to_wasi
shader_stages_to_wasi
stencil_face_to_wasi
stencil_operation_to_wasi
storage_texture_access_to_wasi
store_op_to_wasi
texel_copy_layout_to_wasi
texture_aspect_to_wasi
texture_dimension_from_wasi
texture_dimension_to_wasi
texture_format_from_wasi
texture_format_to_wasi
texture_sample_type_to_wasi
texture_usages_from_wasi
texture_usages_to_wasi
texture_view_dimension_to_wasi
vertex_attribute_to_wasi
vertex_buffer_layout_to_wasi
vertex_format_to_wasi
vertex_step_mode_to_wasi