1#![doc = document_features::document_features!()]
7#![no_std]
18#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
19#![doc(html_logo_url = "https://raw.githubusercontent.com/gfx-rs/wgpu/trunk/logo.png")]
20#![warn(
21 clippy::alloc_instead_of_core,
22 clippy::allow_attributes,
23 clippy::std_instead_of_alloc,
24 clippy::std_instead_of_core,
25 missing_docs,
26 rust_2018_idioms,
27 unsafe_op_in_unsafe_fn
28)]
29#![cfg_attr(not(send_sync), allow(clippy::arc_with_non_send_sync))]
31#![cfg_attr(not(any(wgpu_core, webgpu)), allow(unused))]
32
33extern crate alloc;
34extern crate std;
35#[cfg(wgpu_core)]
36pub extern crate wgpu_core as wgc;
37#[cfg(wgpu_core)]
38pub extern crate wgpu_hal as hal;
39pub extern crate wgpu_types as wgt;
40
41mod api;
48mod backend;
49mod cmp;
50mod dispatch;
51mod macros;
52pub mod util;
53
54#[cfg(custom)]
67pub use backend::custom;
68
69pub use api::*;
70pub use wgt::{
71 AdapterInfo, AddressMode, AllocatorReport, AstcBlock, AstcChannel, Backend, BackendOptions,
72 Backends, BindGroupLayoutEntry, BindingType, BlendComponent, BlendFactor, BlendOperation,
73 BlendState, BufferAddress, BufferBindingType, BufferSize, BufferTransition, BufferUsages,
74 BufferUses, Color, ColorTargetState, ColorWrites, CommandBufferDescriptor, CompareFunction,
75 CompositeAlphaMode, CopyExternalImageDestInfo, CoreCounters, DepthBiasState, DepthStencilState,
76 DeviceLostReason, DeviceType, DownlevelCapabilities, DownlevelFlags, DownlevelLimits,
77 Dx12BackendOptions, Dx12Compiler, DxcShaderModel, DynamicOffset, Extent3d, Face, Features,
78 FeaturesWGPU, FeaturesWebGPU, FilterMode, FrontFace, GlBackendOptions, GlFenceBehavior,
79 Gles3MinorVersion, HalCounters, ImageSubresourceRange, IndexFormat, InstanceDescriptor,
80 InstanceFlags, InternalCounters, Limits, MemoryHints, MultisampleState, NoopBackendOptions,
81 Origin2d, Origin3d, PipelineStatisticsTypes, PollError, PollStatus, PolygonMode,
82 PowerPreference, PredefinedColorSpace, PresentMode, PresentationTimestamp, PrimitiveState,
83 PrimitiveTopology, PushConstantRange, QueryType, RenderBundleDepthStencil, RequestAdapterError,
84 SamplerBindingType, SamplerBorderColor, ShaderLocation, ShaderModel, ShaderRuntimeChecks,
85 ShaderStages, StencilFaceState, StencilOperation, StencilState, StorageTextureAccess,
86 SurfaceCapabilities, SurfaceStatus, TexelCopyBufferLayout, TextureAspect, TextureDimension,
87 TextureFormat, TextureFormatFeatureFlags, TextureFormatFeatures, TextureSampleType,
88 TextureTransition, TextureUsages, TextureUses, TextureViewDimension, Trace, VertexAttribute,
89 VertexFormat, VertexStepMode, WasmNotSend, WasmNotSendSync, WasmNotSync, COPY_BUFFER_ALIGNMENT,
90 COPY_BYTES_PER_ROW_ALIGNMENT, MAP_ALIGNMENT, PUSH_CONSTANT_ALIGNMENT,
91 QUERY_RESOLVE_BUFFER_ALIGNMENT, QUERY_SET_MAX_QUERIES, QUERY_SIZE, VERTEX_STRIDE_ALIGNMENT,
92};
93#[expect(deprecated)]
94pub use wgt::{ImageCopyBuffer, ImageCopyTexture, ImageCopyTextureTagged, ImageDataLayout};
95#[cfg(any(webgpu, webgl))]
98#[expect(deprecated)]
99pub use wgt::ImageCopyExternalImage;
100#[cfg(any(webgpu, webgl))]
101pub use wgt::{CopyExternalImageSourceInfo, ExternalImageSource};
102
103#[cfg(wgpu_core)]
106#[cfg_attr(docsrs, doc(cfg(any(wgpu_core, naga))))]
107pub use ::wgc::naga;
109#[cfg(all(not(wgpu_core), naga))]
112#[cfg_attr(docsrs, doc(cfg(any(wgpu_core, naga))))]
113pub use naga;
115
116pub use raw_window_handle as rwh;
119
120#[cfg(any(webgl, webgpu))]
123pub use web_sys;
124
125#[doc(hidden)]
126pub use macros::helpers as __macro_helpers;