[package] name = "li-wgpu" version.workspace = true authors.workspace = true edition.workspace = true description = "Rusty WebGPU API wrapper" homepage.workspace = true repository.workspace = true keywords.workspace = true license.workspace = true exclude = [ "Cargo.lock", ] [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] targets = [ "x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "wasm32-unknown-unknown", ] [lib] [features] default = ["wgsl"] # Apply run-time checks, even in release builds. These are in addition # to the validation carried out at public APIs in all builds. strict_asserts = ["wgc?/strict_asserts", "wgt/strict_asserts"] spirv = ["naga/spv-in"] glsl = ["naga/glsl-in"] wgsl = ["wgc?/wgsl"] trace = ["serde", "wgc/trace"] replay = ["serde", "wgc/replay"] # Enables the GLES backend on Windows & macOS angle = ["wgc/gles"] webgl = ["hal", "wgc/gles"] # Enables the Vulkan backend on macOS & iOS vulkan-portability = ["wgc/vulkan"] expose-ids = [] # Implement `Send` and `Sync` on Wasm. fragile-send-sync-non-atomic-wasm = ["hal/fragile-send-sync-non-atomic-wasm", "wgc/fragile-send-sync-non-atomic-wasm", "wgt/fragile-send-sync-non-atomic-wasm"] # wgpu-core is always available as an optional dependency, "wgc". # Whenever wgpu-core is selected, we want raw window handle support. [dependencies.wgc] optional = true workspace = true features = ["raw-window-handle"] # wgpu-core is required whenever not targeting web APIs directly. # Whenever wgpu-core is selected, we want raw window handle support. [target.'cfg(any(not(target_arch = "wasm32"), target_os = "emscripten"))'.dependencies.wgc] workspace = true features = ["raw-window-handle"] # We want the wgpu-core Metal backend on macOS and iOS. [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies.wgc] workspace = true features = ["metal"] # We want the wgpu-core Direct3D backends and OpenGL (via WGL) on Windows. [target.'cfg(windows)'.dependencies.wgc] workspace = true features = ["dx11", "dx12", "gles"] # We want the wgpu-core Vulkan backend on Unix (but not emscripten, macOS, iOS) and Windows. [target.'cfg(any(windows, all(unix, not(target_os = "emscripten"), not(target_os = "ios"), not(target_os = "macos"))))'.dependencies.wgc] workspace = true features = ["vulkan"] # We want the wgpu-core GLES backend on Unix (but not macOS, iOS). [target.'cfg(all(unix, not(target_os = "ios"), not(target_os = "macos")))'.dependencies.wgc] workspace = true features = ["gles"] [dependencies.wgt] workspace = true # We need wgpu-hal unless we're targeting the web APIs. [target.'cfg(any(not(target_arch = "wasm32"), target_os = "emscripten"))'.dependencies] hal = { workspace = true } [target.'cfg(all(not(target_arch = "wasm32"), unix, not(target_os = "ios"), not(target_os = "macos")))'.dependencies] hal = { workspace = true, features = ["renderdoc"] } [target.'cfg(windows)'.dependencies] hal = { workspace = true, features = ["dxc_shader_compiler", "renderdoc", "windows_rs"] } [target.'cfg(target_arch = "wasm32")'.dependencies.hal] workspace = true optional = true [dependencies] arrayvec.workspace = true cfg-if.workspace = true flume.workspace = true log.workspace = true parking_lot.workspace = true profiling.workspace = true raw-window-handle.workspace = true serde = { workspace = true, features = ["derive"], optional = true } smallvec.workspace = true static_assertions.workspace = true [dependencies.naga] workspace = true features = ["clone"] optional = true # used to test all the example shaders [dev-dependencies.naga] workspace = true features = ["wgsl-in"] [target.'cfg(target_arch = "wasm32")'.dependencies.naga] workspace = true features = ["wgsl-out"] [target.'cfg(target_arch = "wasm32")'.dependencies] web-sys = { workspace = true, features = [ "Document", "Navigator", "Node", "NodeList", "Gpu", "GpuAdapter", "GpuAddressMode", "GpuAutoLayoutMode", "GpuBindGroup", "GpuBindGroupDescriptor", "GpuBindGroupEntry", "GpuBindGroupLayout", "GpuBindGroupLayoutDescriptor", "GpuBindGroupLayoutEntry", "GpuBlendComponent", "GpuBlendFactor", "GpuBlendOperation", "GpuBlendState", "GpuBuffer", "GpuBufferBinding", "GpuBufferBindingLayout", "GpuBufferBindingType", "GpuBufferDescriptor", "GpuCanvasAlphaMode", "GpuCanvasContext", "GpuCanvasConfiguration", "GpuColorDict", "GpuColorTargetState", "GpuCommandBuffer", "GpuCommandBufferDescriptor", "GpuCommandEncoder", "GpuCommandEncoderDescriptor", "GpuCompareFunction", "GpuCompilationInfo", "GpuCompilationMessage", "GpuCompilationMessageType", "GpuComputePassDescriptor", "GpuComputePassEncoder", "GpuComputePassTimestampWrites", "GpuComputePipeline", "GpuComputePipelineDescriptor", "GpuCullMode", "GpuDepthStencilState", "GpuDevice", "GpuDeviceDescriptor", "GpuDeviceLostInfo", "GpuDeviceLostReason", "GpuError", "GpuErrorFilter", # "GpuExtent2dDict", Not yet implemented in web_sys "GpuExtent3dDict", "GpuFeatureName", "GpuFilterMode", "GpuFragmentState", "GpuFrontFace", "GpuImageCopyBuffer", "GpuImageCopyExternalImage", "GpuImageCopyTexture", "GpuImageCopyTextureTagged", "GpuImageDataLayout", "GpuIndexFormat", "GpuLoadOp", "gpu_map_mode", "GpuMipmapFilterMode", "GpuMultisampleState", "GpuObjectDescriptorBase", "GpuOrigin2dDict", "GpuOrigin3dDict", "GpuOutOfMemoryError", "GpuPipelineDescriptorBase", "GpuPipelineLayout", "GpuPipelineLayoutDescriptor", "GpuPowerPreference", "GpuPrimitiveState", "GpuPrimitiveTopology", "GpuProgrammableStage", "GpuQuerySet", "GpuQuerySetDescriptor", "GpuQueryType", "GpuQueue", "GpuRenderBundle", "GpuRenderBundleDescriptor", "GpuRenderBundleEncoder", "GpuRenderBundleEncoderDescriptor", "GpuRenderPassColorAttachment", "GpuRenderPassDepthStencilAttachment", "GpuRenderPassDescriptor", "GpuRenderPassEncoder", "GpuRenderPipeline", "GpuRenderPipelineDescriptor", "GpuRequestAdapterOptions", "GpuSampler", "GpuSamplerBindingLayout", "GpuSamplerBindingType", "GpuSamplerDescriptor", "GpuShaderModule", "GpuShaderModuleDescriptor", "GpuStencilFaceState", "GpuStencilOperation", "GpuStorageTextureAccess", "GpuStorageTextureBindingLayout", "GpuStoreOp", "GpuSupportedFeatures", "GpuSupportedLimits", "GpuTexture", "GpuTextureAspect", "GpuTextureBindingLayout", "GpuTextureDescriptor", "GpuTextureDimension", "GpuTextureFormat", "GpuTextureSampleType", "GpuTextureView", "GpuTextureViewDescriptor", "GpuTextureViewDimension", "GpuUncapturedErrorEvent", "GpuUncapturedErrorEventInit", "GpuValidationError", "GpuVertexAttribute", "GpuVertexBufferLayout", "GpuVertexFormat", "GpuVertexState", "GpuVertexStepMode", "HtmlCanvasElement", "OffscreenCanvas", "ImageBitmap", "ImageBitmapRenderingContext", "Window", "WorkerGlobalScope", "WorkerNavigator" ] } wasm-bindgen.workspace = true js-sys.workspace = true wasm-bindgen-futures.workspace = true parking_lot.workspace = true