Expand description
This library describes the API surface of WebGPU that is agnostic of the backend. This API is used for targeting both Web and Native.
Re-exports§
pub use instance::*;
Modules§
- assertions
- Macros for validation internal to the wgpu.
- instance
- Types for dealing with Instances
- math
- Utilitary math functions.
Macros§
- strict_
assert strict_asserts
- This is equivalent to
core::assert
if thestrict_asserts
feature is activated, otherwise equal tocore::debug_assert
. - strict_
assert_ eq strict_asserts
- This is equivalent to
core::assert_eq
if thestrict_asserts
feature is activated, otherwise equal tocore::debug_assert_eq
. - strict_
assert_ ne strict_asserts
- This is equivalent to
core::assert_ne
if thestrict_asserts
feature is activated, otherwise equal tocore::debug_assert_ne
.
Structs§
- Acceleration
Structure Flags - Flags for acceleration structures
- Acceleration
Structure Geometry Flags - Flags for acceleration structure geometries
- Adapter
Info - Information about an adapter.
- Allocation
Report - Describes an allocation in the
AllocatorReport
. - Allocator
Report - A report that can be generated for informational purposes using
Allocator::generate_report()
. - Backends
- Represents the backends that wgpu will use.
- Bind
Group Layout Entry - Describes a single binding inside a bind group.
- Blas
Triangle Geometry Size Descriptor - Descriptor for all size defining attributes of a single triangle geometry inside a bottom level acceleration structure.
- Blend
Component - Describes a blend component of a
BlendState
. - Blend
State - Describe the blend state of a render pipeline,
within
ColorTargetState
. - Buffer
Descriptor - Describes a
Buffer
. - Buffer
Usages - Different ways that you can use a buffer.
- Color
- RGBA double precision color.
- Color
Target State - Describes the color state of a render pipeline.
- Color
Writes - Color write mask. Disabled color channels will not be written to.
- Command
Buffer Descriptor - Describes a
CommandBuffer
. - Command
Encoder Descriptor - Describes a
CommandEncoder
. - Copy
External Image Dest Info - View of a texture which can be used to copy to a texture, including color space and alpha premultiplication information.
- Core
Counters wgpu-core
’s internal counters.- Create
Blas Descriptor - Descriptor for creating a bottom level acceleration structure.
- Create
Tlas Descriptor - Descriptor for creating a top level acceleration structure.
- Depth
Bias State - Describes the biasing setting for the depth target.
- Depth
Stencil State - Describes the depth/stencil state in a render pipeline.
- Device
Descriptor - Describes a
Device
. - Dispatch
Indirect Args - Argument buffer layout for dispatch_indirect commands.
- Downlevel
Capabilities - Lists various ways the underlying platform does not conform to the WebGPU standard.
- Downlevel
Flags - Binary flags listing features that may or may not be present on downlevel adapters.
- Downlevel
Limits - Represents the sets of additional limits on an adapter, which take place when running on downlevel backends.
- Draw
Indexed Indirect Args - Argument buffer layout for draw_indexed_indirect commands.
- Draw
Indirect Args - Argument buffer layout for draw_indirect commands.
- Extent3d
- Extent of a texture related operation.
- Features
- Features that are not guaranteed to be supported.
- HalCounters
wgpu-hal
’s internal counters.- Image
Subresource Range - Subresource range within an image
- Internal
Counter - An internal counter for debugging purposes
- Internal
Counters - All internal counters, exposed for debugging purposes.
- Limits
- Represents the sets of limits an adapter/device supports.
- Memory
Block Report - Describes a memory block in the
AllocatorReport
. - Multisample
State - Describes the multi-sampling state of a render pipeline.
- Operations
- Pair of load and store operations for an attachment aspect.
- Origin2d
- Origin of a copy from a 2D image.
- Origin3d
- Origin of a copy to/from a texture.
- Pipeline
Statistics Types - Flags for which pipeline data should be recorded.
- Presentation
Timestamp - Nanosecond timestamp used by the presentation engine.
- Primitive
State - Describes the state of primitive assembly and rasterization in a render pipeline.
- Push
Constant Range - A range of push constant memory to pass to a shader stage.
- Query
SetDescriptor - Describes how to create a QuerySet.
- Render
Bundle Depth Stencil - Describes the depth/stencil attachment for render bundles.
- Render
Bundle Descriptor - Describes a
RenderBundle
. - Request
Adapter Options - Options for requesting adapter.
- Sampler
Descriptor - Describes a
Sampler
. - Shader
Runtime Checks - Describes how shader bound checks should be performed.
- Shader
Stages - Describes the shader stages that a binding will be visible from.
- Stencil
Face State - Describes stencil state in a render pipeline.
- Stencil
State - State of the stencil operation (fixed-pipeline stage).
- Surface
Capabilities - Defines the capabilities of a given surface and adapter.
- Surface
Configuration - Configures a
Surface
for presentation. - Texel
Copy Buffer Info - View of a buffer which can be used to copy to/from a texture.
- Texel
Copy Buffer Layout - Layout of a texture in a buffer’s memory.
- Texel
Copy Texture Info - View of a texture which can be used to copy to/from a buffer/texture.
- Texture
Descriptor - Describes a
Texture
. - Texture
Format Feature Flags - Feature flags for a texture format.
- Texture
Format Features - Features supported by a given texture format
- Texture
Usages - Different ways that you can use a texture.
- Texture
View Descriptor - Describes a
TextureView
. - Vertex
Attribute - Vertex inputs (attributes) to shaders.
Enums§
- Acceleration
Structure Update Mode - Update mode for acceleration structure builds.
- Address
Mode - How edges should be handled in texture addressing.
- Astc
Block - ASTC block dimensions
- Astc
Channel - ASTC RGBA channel
- Backend
- Backends supported by wgpu.
- Binding
Type - Specific type of a binding.
- Blas
Geometry Size Descriptors - Descriptor for all size defining attributes of all geometries inside a bottom level acceleration structure.
- Blend
Factor - Alpha blend factor.
- Blend
Operation - Alpha blend operation.
- Buffer
Binding Type - Specific type of a buffer binding.
- Compare
Function - Comparison function used for depth and stencil operations.
- Composite
Alpha Mode - Specifies how the alpha channel of the textures should be handled during compositing.
- Device
Lost Reason - Reason for “lose the device”.
- Device
Type - Supported physical device types.
- Face
- Face of a vertex.
- Filter
Mode - Texel mixing mode when sampling between texels.
- Front
Face - Vertex winding order which classifies the “front” face of a triangle.
- Index
Format - Format of indices used with pipeline.
- LoadOp
- Operation to perform to the output attachment at the start of a render pass.
- Maintain
- Passed to
Device::poll
to control how and if it should block. - Maintain
Result - Result of a maintain operation.
- Memory
Hints - Hints to the device about the memory allocation strategy.
- Polygon
Mode - Type of drawing mode for polygons
- Power
Preference - Power Preference when choosing a physical adapter.
- Predefined
Color Space - Color spaces supported on the web.
- Present
Mode - Behavior of the presentation engine based on frame rate.
- Primitive
Topology - Primitive type the input mesh is composed of.
- Query
Type - Type of query contained in a QuerySet.
- Sampler
Binding Type - Specific type of a sampler binding.
- Sampler
Border Color - Color variation to use when sampler addressing mode is
AddressMode::ClampToBorder
- Shader
Model - Collections of shader features a device supports if they support less than WebGPU normally allows.
- Stencil
Operation - Operation to perform on the stencil value.
- Storage
Texture Access - Specific type of a sample in a texture binding.
- StoreOp
- Operation to perform to the output attachment at the end of a render pass.
- Surface
Status - Status of the received surface image.
- Texture
Aspect - Kind of data the texture holds.
- Texture
Data Order - Order in which TextureData is laid out in memory.
- Texture
Dimension - Dimensionality of a texture.
- Texture
Format - Underlying texture data format.
- Texture
Sample Type - Specific type of a sample in a texture binding.
- Texture
View Dimension - Dimensions of a particular texture view.
- Vertex
Format - Vertex Format for a
VertexAttribute
(input). - Vertex
Step Mode - Whether a vertex buffer is indexed by vertex or by instance.
Constants§
- COPY_
BUFFER_ ALIGNMENT - Buffer to buffer copy as well as buffer clear offsets and sizes must be aligned to this number.
- COPY_
BYTES_ PER_ ROW_ ALIGNMENT - Buffer-Texture copies must have
bytes_per_row
aligned to this number. - INSTANCE_
BUFFER_ ALIGNMENT - Alignment requirement for instance buffers used in acceleration structure builds (
build_acceleration_structures_unsafe_tlas
) - MAP_
ALIGNMENT - Size to align mappings.
- PUSH_
CONSTANT_ ALIGNMENT - Alignment all push constants need
- QUERY_
RESOLVE_ BUFFER_ ALIGNMENT - An offset into the query resolve buffer has to be aligned to this.
- QUERY_
SET_ MAX_ QUERIES - Maximum queries in a query set
- QUERY_
SIZE - Size of a single piece of query data.
- TRANSFORM_
BUFFER_ ALIGNMENT - Alignment requirement for transform buffers used in acceleration structure builds
- VERTEX_
STRIDE_ ALIGNMENT - Vertex buffer strides have to be aligned to this number.
Traits§
- Wasm
NotSend Non-WebAssembly, or fragile-send-sync-non-atomic-wasm
and non-atomics
- Wasm
NotSend Sync - Wasm
NotSync Non-WebAssembly, or fragile-send-sync-non-atomic-wasm
and non-atomics
Type Aliases§
- Buffer
Address - Integral type used for buffer offsets.
- Buffer
Size - Integral type used for buffer slice sizes.
- Dynamic
Offset - Integral type used for dynamic bind group offsets.
- Image
Copy Buffer Deprecated - Old name for a
TexelCopyBufferInfo
. - Image
Copy Texture Deprecated - Old name for a
TexelCopyTextureInfo
. - Image
Copy Texture Tagged Deprecated - Old name for a
CopyExternalImageDestInfo
. - Image
Data Layout Deprecated - Old name for a
TexelCopyBufferLayout
. - Shader
Location - Integral type used for binding locations in shaders.