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