Crate wgpu_types

Source
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§

bytemuck_wrapper
Wrapper to unsafely define a wrapper type that can be used with bytemuck’s traits.
strict_assertstrict_asserts
This is equivalent to core::assert if the strict_asserts feature is activated, otherwise equal to core::debug_assert.
strict_assert_eqstrict_asserts
This is equivalent to core::assert_eq if the strict_asserts feature is activated, otherwise equal to core::debug_assert_eq.
strict_assert_nestrict_asserts
This is equivalent to core::assert_ne if the strict_asserts feature is activated, otherwise equal to core::debug_assert_ne.

Structs§

AccelerationStructureFlags
Flags for acceleration structures
AccelerationStructureGeometryFlags
Flags for acceleration structure geometries
AdapterInfo
Information about an adapter.
AllocationReport
Describes an allocation in the AllocatorReport.
AllocatorReport
A report that can be generated for informational purposes using Allocator::generate_report().
Backends
Represents the backends that wgpu will use.
BindGroupLayoutEntry
Describes a single binding inside a bind group.
BlasTriangleGeometrySizeDescriptor
Descriptor for all size defining attributes of a single triangle geometry inside a bottom level acceleration structure.
BlendComponent
Describes a blend component of a BlendState.
BlendState
Describe the blend state of a render pipeline, within ColorTargetState.
BufferDescriptor
Describes a Buffer.
BufferTransition
A buffer transition for use with CommandEncoder::transition_resources.
BufferUsages
Different ways that you can use a buffer.
BufferUses
Similar to BufferUsages, but used only for CommandEncoder::transition_resources.
Color
RGBA double precision color.
ColorTargetState
Describes the color state of a render pipeline.
ColorWrites
Color write mask. Disabled color channels will not be written to.
CommandBufferDescriptor
Describes a CommandBuffer.
CommandEncoderDescriptor
Describes a CommandEncoder.
CopyExternalImageDestInfo
View of a texture which can be used to copy to a texture, including color space and alpha premultiplication information.
CoreCounters
wgpu-core’s part of InternalCounters.
CreateBlasDescriptor
Descriptor for creating a bottom level acceleration structure.
CreateTlasDescriptor
Descriptor for creating a top level acceleration structure.
DepthBiasState
Describes the biasing setting for the depth target.
DepthStencilState
Describes the depth/stencil state in a render pipeline.
DeviceDescriptor
Describes a Device.
DispatchIndirectArgs
Argument buffer layout for dispatch_indirect commands.
DownlevelCapabilities
Lists various ways the underlying platform does not conform to the WebGPU standard.
DownlevelFlags
Binary flags listing features that may or may not be present on downlevel adapters.
DownlevelLimits
Represents the sets of additional limits on an adapter, which take place when running on downlevel backends.
DrawIndexedIndirectArgs
Argument buffer layout for draw_indexed_indirect commands.
DrawIndirectArgs
Argument buffer layout for draw_indirect commands.
Extent3d
Extent of a texture related operation.
FeatureBits
Bits from Features in array form
Features
Features that are not guaranteed to be supported.
FeaturesWGPU
Features that are not guaranteed to be supported.
FeaturesWebGPU
Features that are not guaranteed to be supported.
HalCounters
wgpu-hal’s part of InternalCounters.
ImageSubresourceRange
Subresource range within an image
InternalCounter
An internal counter for debugging purposes
InternalCounters
All internal counters, exposed for debugging purposes.
Limits
Represents the sets of limits an adapter/device supports.
MemoryBlockReport
Describes a memory block in the AllocatorReport.
MultisampleState
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.
PipelineStatisticsTypes
Flags for which pipeline data should be recorded in a query.
PresentationTimestamp
Nanosecond timestamp used by the presentation engine.
PrimitiveState
Describes the state of primitive assembly and rasterization in a render pipeline.
PushConstantRange
A range of push constant memory to pass to a shader stage.
QuerySetDescriptor
Describes how to create a QuerySet.
RenderBundleDepthStencil
Describes the depth/stencil attachment for render bundles.
RenderBundleDescriptor
Describes a RenderBundle.
RequestAdapterOptions
Options for requesting adapter.
SamplerDescriptor
Describes a Sampler.
ShaderModuleDescriptorMsl
Descriptor for a shader module given by Metal MSL source.
ShaderModuleDescriptorSpirV
Descriptor for a shader module given by SPIR-V binary.
ShaderRuntimeChecks
Describes how shader bound checks should be performed.
ShaderStages
Describes the shader stages that a binding will be visible from.
StencilFaceState
Describes stencil state in a render pipeline.
StencilState
State of the stencil operation (fixed-pipeline stage).
SurfaceCapabilities
Defines the capabilities of a given surface and adapter.
SurfaceConfiguration
Configures a Surface for presentation.
TexelCopyBufferInfo
View of a buffer which can be used to copy to/from a texture.
TexelCopyBufferLayout
Layout of a texture in a buffer’s memory.
TexelCopyTextureInfo
View of a texture which can be used to copy to/from a buffer/texture.
TextureDescriptor
Describes a Texture.
TextureFormatFeatureFlags
Feature flags for a texture format.
TextureFormatFeatures
Features supported by a given texture format
TextureSelector
Specifies a particular set of subresources in a texture.
TextureTransition
A texture transition for use with CommandEncoder::transition_resources.
TextureUsages
Different ways that you can use a texture.
TextureUses
Similar to TextureUsages, but used only for CommandEncoder::transition_resources.
TextureViewDescriptor
Describes a TextureView.
VertexAttribute
Vertex inputs (attributes) to shaders.

Enums§

AccelerationStructureCopy
What a copy between acceleration structures should do
AccelerationStructureType
What type the data of an acceleration structure is
AccelerationStructureUpdateMode
Update mode for acceleration structure builds.
AddressMode
How edges should be handled in texture addressing.
AstcBlock
ASTC block dimensions
AstcChannel
ASTC RGBA channel
Backend
Backends supported by wgpu.
BindingType
Type of a binding in a bind group layout.
BlasGeometrySizeDescriptors
Descriptor for all size defining attributes of all geometries inside a bottom level acceleration structure.
BlendFactor
Alpha blend factor.
BlendOperation
Alpha blend operation.
BufferBindingType
Specific type of a buffer binding.
CompareFunction
Comparison function used for depth and stencil operations.
CompositeAlphaMode
Specifies how the alpha channel of the textures should be handled during compositing.
CreateShaderModuleDescriptorPassthrough
Descriptor for creating a shader module.
DeviceLostReason
Reason for “lose the device”.
DeviceType
Supported physical device types.
Face
Face of a vertex.
FilterMode
Texel mixing mode when sampling between texels.
FrontFace
Vertex winding order which classifies the “front” face of a triangle.
IndexFormat
Format of indices used with pipeline.
LoadOp
Operation to perform to the output attachment at the start of a render pass.
MemoryHints
Hints to the device about the memory allocation strategy.
PollError
Error states after a device poll
PollStatus
Status of device poll operation.
PollType
Passed to Device::poll to control how and if it should block.
PolygonMode
Type of drawing mode for polygons
PowerPreference
Power Preference when choosing a physical adapter.
PredefinedColorSpace
Color spaces supported on the web.
PresentMode
Timing and queueing with which frames are actually displayed to the user.
PrimitiveTopology
Primitive type the input mesh is composed of.
QueryType
Type of query contained in a QuerySet.
RequestAdapterError
Error when Instance::request_adapter() fails.
SamplerBindingType
Specific type of a sampler binding.
SamplerBorderColor
Color variation to use when sampler addressing mode is AddressMode::ClampToBorder
ShaderModel
Collections of shader features a device supports if they support less than WebGPU normally allows.
StencilOperation
Operation to perform on the stencil value.
StorageTextureAccess
Specific type of a sample in a texture binding.
StoreOp
Operation to perform to the output attachment at the end of a render pass.
SurfaceStatus
Status of the received surface image.
TextureAspect
Selects a subset of the data a Texture holds.
TextureDataOrder
Order in which texture data is laid out in memory.
TextureDimension
Dimensionality of a texture.
TextureFormat
Format in which a texture’s texels are stored in GPU memory.
TextureSampleType
Specific type of a sample in a texture binding.
TextureViewDimension
Dimensions of a particular texture view.
Trace
Controls API call tracing and specifies where the trace is written.
VertexFormat
Vertex Format for a VertexAttribute (input).
VertexStepMode
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-to-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
Minimum alignment of buffer mappings.
PUSH_CONSTANT_ALIGNMENT
Ranges of writes to push constant storage must be at least this aligned.
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 QuerySetDescriptor.
QUERY_SIZE
Size in bytes 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 a multiple of this number.

Traits§

WasmNotSendNon-WebAssembly, or fragile-send-sync-non-atomic-wasm and non-atomics
WasmNotSendSync
WasmNotSyncNon-WebAssembly, or fragile-send-sync-non-atomic-wasm and non-atomics

Type Aliases§

BufferAddress
Integral type used for Buffer offsets and sizes.
BufferSize
Integral type used for BufferSlice sizes.
DynamicOffset
Integral type used for dynamic bind group offsets.
ImageCopyBufferDeprecated
Old name for a TexelCopyBufferInfo.
ImageCopyTextureDeprecated
Old name for a TexelCopyTextureInfo.
ImageCopyTextureTaggedDeprecated
Old name for a CopyExternalImageDestInfo.
ImageDataLayoutDeprecated
Old name for a TexelCopyBufferLayout.
ShaderLocation
Integral type used for binding locations in shaders.