1#![doc = crate::macros::doc_image!("render_coordinates.webp")]
37#![doc = crate::macros::doc_image!("texture_coordinates.webp")]
38#![no_std]
39#![recursion_limit = "256"]
41#![cfg_attr(docsrs, feature(doc_cfg))]
42#![doc(html_logo_url = "https://raw.githubusercontent.com/gfx-rs/wgpu/trunk/logo.png")]
43#![warn(
44 clippy::alloc_instead_of_core,
45 clippy::allow_attributes,
46 clippy::std_instead_of_alloc,
47 clippy::std_instead_of_core,
48 missing_docs,
49 rust_2018_idioms,
50 unsafe_op_in_unsafe_fn
51)]
52#![allow(
53 clippy::large_enum_variant,
55 clippy::bool_assert_comparison,
57 clippy::bool_comparison,
58)]
59#![cfg_attr(not(send_sync), allow(clippy::arc_with_non_send_sync))]
61#![cfg_attr(not(any(wgpu_core, webgpu)), allow(unused))]
62
63extern crate alloc;
64#[cfg(any(std, test))]
65extern crate std;
66#[cfg(wgpu_core)]
67pub extern crate wgpu_core as wgc;
68#[cfg(wgpu_core)]
69pub extern crate wgpu_hal as hal;
70pub extern crate wgpu_types as wgt;
71
72mod api;
79mod backend;
80mod cmp;
81mod dispatch;
82pub mod documentation;
83mod macros;
84pub mod util;
85
86#[cfg(custom)]
93pub use backend::custom;
94
95pub use api::*;
96pub use wgt::{
97 AdapterInfo, AddressMode, AllocatorReport, AstcBlock, AstcChannel, Backend, BackendOptions,
98 Backends, BindGroupLayoutEntry, BindingType, BlendComponent, BlendFactor, BlendOperation,
99 BlendState, BufferAddress, BufferBindingType, BufferSize, BufferTextureCopyInfo,
100 BufferTransition, BufferUsages, BufferUses, Color, ColorTargetState, ColorWrites,
101 CommandBufferDescriptor, CompareFunction, ComponentSwizzle, CompositeAlphaMode,
102 CooperativeMatrixProperties, CooperativeScalarType, CopyExternalImageDestInfo, CoreCounters,
103 DepthBiasState, DepthStencilState, DeviceLostReason, DeviceType, DisplayChromaticity,
104 DisplayCoarseRange, DisplayGamut, DisplayHdrInfo, DisplayHeadroom, DisplayLuminance,
105 DownlevelCapabilities, DownlevelFlags, DownlevelLimits, Dx12BackendOptions, Dx12Compiler,
106 Dx12SwapchainKind, Dx12UseFrameLatencyWaitableObject, DxcShaderModel, DynamicOffset,
107 ExperimentalFeatures, Extent3d, ExternalTextureFormat, ExternalTextureTransferFunction, Face,
108 Features, FeaturesWGPU, FeaturesWebGPU, FilterMode, ForceShaderModelToken, FrontFace,
109 GlBackendOptions, GlDebugFns, GlFenceBehavior, Gles3MinorVersion, HalCounters,
110 ImageSubresourceRange, IndexFormat, InstanceDescriptor, InstanceFlags, InternalCounters,
111 Limits, LoadOpDontCare, MemoryBudgetThresholds, MemoryHints, MipmapFilterMode,
112 MultisampleState, NoopBackendOptions, Origin2d, Origin3d, PassthroughShaderEntryPoint,
113 PipelineStatisticsTypes, PollError, PollStatus, PolygonMode, PowerPreference,
114 PredefinedColorSpace, PresentMode, PresentationTimestamp, PrimitiveState, PrimitiveTopology,
115 QueryType, RenderBundleDepthStencil, RequestAdapterError, SamplerBindingType,
116 SamplerBorderColor, ShaderLocation, ShaderModel, ShaderRuntimeChecks, ShaderStages,
117 StencilFaceState, StencilOperation, StencilState, StorageTextureAccess, SurfaceCapabilities,
118 SurfaceColorSpace, SurfaceColorSpaces, SurfaceFormatCapabilities, SurfaceStatus,
119 TexelCopyBufferLayout, TextureAspect, TextureChannel, TextureComponentSwizzle,
120 TextureDimension, TextureFormat, TextureFormatFeatureFlags, TextureFormatFeatures,
121 TextureSampleType, TextureTransition, TextureUsages, TextureUses, TextureViewDimension, Trace,
122 VertexAttribute, VertexFormat, VertexStepMode, WasmNotSend, WasmNotSendSync, WasmNotSync,
123 WriteOnly, WriteOnlyIter, COPY_BUFFER_ALIGNMENT, COPY_BYTES_PER_ROW_ALIGNMENT,
124 IMMEDIATE_DATA_ALIGNMENT, MAP_ALIGNMENT, MAXIMUM_SUBGROUP_MAX_SIZE, MINIMUM_SUBGROUP_MIN_SIZE,
125 QUERY_RESOLVE_BUFFER_ALIGNMENT, QUERY_SET_MAX_QUERIES, QUERY_SIZE, VERTEX_ALIGNMENT,
126};
127
128#[expect(deprecated)]
129pub use wgt::VERTEX_STRIDE_ALIGNMENT;
130
131#[cfg(web)]
134pub use wgt::{CopyExternalImageSourceInfo, ExternalImageSource};
135
136#[cfg(wgpu_core)]
139#[cfg_attr(docsrs, doc(cfg(any(wgpu_core, naga))))]
140pub use ::wgc::naga;
142#[cfg(all(not(wgpu_core), naga))]
145#[cfg_attr(docsrs, doc(cfg(any(wgpu_core, naga))))]
146pub use naga;
148
149pub use raw_window_handle as rwh;
152
153#[cfg(web)]
156pub use web_sys;
157
158#[cfg(webgpu)]
169pub mod webgpu {
170 pub use crate::backend::webgpu::webgpu_sys::{
171 GpuBuffer, GpuDevice, GpuExternalTexture, GpuQueue, GpuTexture, GpuTextureView,
172 };
173 pub use crate::backend::webgpu::{DropCallback, ExternalTextureSource};
174}
175
176#[doc(hidden)]
177pub use macros::helpers as __macro_helpers;