#![doc = crate::macros::doc_image!("render_coordinates.webp")]
#![doc = crate::macros::doc_image!("texture_coordinates.webp")]
#![no_std]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(html_logo_url = "https://raw.githubusercontent.com/gfx-rs/wgpu/trunk/logo.png")]
#![warn(
clippy::alloc_instead_of_core,
clippy::allow_attributes,
clippy::std_instead_of_alloc,
clippy::std_instead_of_core,
missing_docs,
rust_2018_idioms,
unsafe_op_in_unsafe_fn
)]
#![allow(
// We need to investiagate these.
clippy::large_enum_variant,
// These degrade readability significantly.
clippy::bool_assert_comparison,
clippy::bool_comparison,
)]
#![cfg_attr(not(send_sync), allow(clippy::arc_with_non_send_sync))]
#![cfg_attr(not(any(wgpu_core, webgpu)), allow(unused))]
extern crate alloc;
#[cfg(any(std, test))]
extern crate std;
#[cfg(wgpu_core)]
pub extern crate wgpu_core as wgc;
#[cfg(wgpu_core)]
pub extern crate wgpu_hal as hal;
pub extern crate wgpu_types as wgt;
mod api;
mod backend;
mod cmp;
mod dispatch;
pub mod documentation;
mod macros;
pub mod util;
#[cfg(custom)]
pub use backend::custom;
pub use api::*;
pub use wgt::{
AdapterInfo, AddressMode, AllocatorReport, AstcBlock, AstcChannel, Backend, BackendOptions,
Backends, BindGroupLayoutEntry, BindingType, BlendComponent, BlendFactor, BlendOperation,
BlendState, BufferAddress, BufferBindingType, BufferSize, BufferTextureCopyInfo,
BufferTransition, BufferUsages, BufferUses, Color, ColorTargetState, ColorWrites,
CommandBufferDescriptor, CompareFunction, ComponentSwizzle, CompositeAlphaMode,
CooperativeMatrixProperties, CooperativeScalarType, CopyExternalImageDestInfo, CoreCounters,
DepthBiasState, DepthStencilState, DeviceLostReason, DeviceType, DisplayChromaticity,
DisplayCoarseRange, DisplayGamut, DisplayHdrInfo, DisplayHeadroom, DisplayLuminance,
DownlevelCapabilities, DownlevelFlags, DownlevelLimits, Dx12BackendOptions, Dx12Compiler,
Dx12SwapchainKind, Dx12UseFrameLatencyWaitableObject, DxcShaderModel, DynamicOffset,
ExperimentalFeatures, Extent3d, ExternalTextureFormat, ExternalTextureTransferFunction, Face,
Features, FeaturesWGPU, FeaturesWebGPU, FilterMode, ForceShaderModelToken, FrontFace,
GlBackendOptions, GlDebugFns, GlFenceBehavior, Gles3MinorVersion, HalCounters,
ImageSubresourceRange, IndexFormat, InstanceDescriptor, InstanceFlags, InternalCounters,
Limits, LoadOpDontCare, MapMode, MemoryBudgetThresholds, MemoryHints, MipmapFilterMode,
MultisampleState, NoopBackendOptions, Origin2d, Origin3d, PassthroughShaderEntryPoint,
PipelineStatisticsTypes, PollError, PollStatus, PolygonMode, PowerPreference,
PredefinedColorSpace, PresentMode, PresentationTimestamp, PrimitiveState, PrimitiveTopology,
QueryType, RayTracingInvocationReorderMode, Rect, RenderBundleDepthStencil,
RequestAdapterError, SamplerBindingType, SamplerBorderColor, ShaderLocation, ShaderModel,
ShaderRuntimeChecks, ShaderStages, StencilFaceState, StencilOperation, StencilState,
StorageTextureAccess, SurfaceCapabilities, SurfaceColorSpace, SurfaceColorSpaces,
SurfaceFormatCapabilities, SurfaceStatus, TexelCopyBufferLayout, TextureAspect, TextureChannel,
TextureComponentSwizzle, TextureDimension, TextureFormat, TextureFormatFeatureFlags,
TextureFormatFeatures, TextureSampleType, TextureTransition, TextureUsages, TextureUses,
TextureViewDimension, Trace, VertexAttribute, VertexFormat, VertexStepMode,
VulkanBackendOptions, VulkanSwapchainKind, WasmNotSend, WasmNotSendSync, WasmNotSync,
WriteOnly, WriteOnlyIter, COPY_BUFFER_ALIGNMENT, COPY_BYTES_PER_ROW_ALIGNMENT,
IMMEDIATE_DATA_ALIGNMENT, MAP_ALIGNMENT, MAXIMUM_SUBGROUP_MAX_SIZE, MINIMUM_SUBGROUP_MIN_SIZE,
QUERY_RESOLVE_BUFFER_ALIGNMENT, QUERY_SET_MAX_QUERIES, QUERY_SIZE, VERTEX_ALIGNMENT,
};
#[expect(deprecated)]
pub use wgt::VERTEX_STRIDE_ALIGNMENT;
#[cfg(web)]
pub use wgt::{CopyExternalImageSourceInfo, ExternalImageSource};
#[cfg(wgpu_core)]
#[cfg_attr(docsrs, doc(cfg(any(wgpu_core, naga))))]
pub use ::wgc::naga;
#[cfg(all(not(wgpu_core), naga))]
#[cfg_attr(docsrs, doc(cfg(any(wgpu_core, naga))))]
pub use naga;
pub use raw_window_handle as rwh;
#[cfg(web)]
pub use web_sys;
#[cfg(webgpu)]
pub mod webgpu {
pub use crate::backend::webgpu::webgpu_sys::{
GpuBuffer, GpuDevice, GpuExternalTexture, GpuQueue, GpuTexture, GpuTextureView,
};
pub use crate::backend::webgpu::{DropCallback, ExternalTextureSource};
}
#[doc(hidden)]
pub use macros::helpers as __macro_helpers;