gpu-handle-types 0.2.0

Typed, owned native GPU resource handles (Vulkan, D3D11/12, Metal, OpenGL, CUDA, OpenCL, DMA-BUF, IOSurface, AHardwareBuffer, WebGPU, ...), cross-API sync points and video pixel formats, for passing GPU resources between libraries.
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
rust-version = "1.88"
name = "gpu-handle-types"
version = "0.2.0"
authors = ["Adrian <adrian.eddy@gmail.com>"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Typed, owned native GPU resource handles (Vulkan, D3D11/12, Metal, OpenGL, CUDA, OpenCL, DMA-BUF, IOSurface, AHardwareBuffer, WebGPU, ...), cross-API sync points and video pixel formats, for passing GPU resources between libraries."
readme = "README.md"
keywords = [
    "gpu",
    "wgpu",
    "handle",
    "pixel-format",
    "interop",
]
categories = [
    "graphics",
    "multimedia::video",
    "data-structures",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/AdrianEddy/wgpu-interop"
resolver = "2"

[package.metadata.docs.rs]
all-features = true
default-target = "x86_64-unknown-linux-gnu"
targets = [
    "x86_64-unknown-linux-gnu",
    "x86_64-pc-windows-msvc",
    "aarch64-apple-darwin",
    "aarch64-linux-android",
]
rustdoc-args = [
    "--cfg",
    "docsrs",
]

[features]
ash = ["dep:ash"]
cuda = []
default = ["wgpu"]
opencl = []
serde = [
    "dep:serde",
    "video-types/serde",
]
web = [
    "dep:wasm-bindgen",
    "dep:js-sys",
    "dep:web-sys",
]
web-codecs = [
    "web",
    "web-sys/VideoFrame",
]
webgl = ["web"]
wgpu = ["dep:wgpu"]

[lib]
name = "gpu_handle_types"
path = "src/lib.rs"

[[test]]
name = "alpha_channel"
path = "tests/alpha_channel.rs"

[[test]]
name = "budget"
path = "tests/budget.rs"

[[test]]
name = "compile_fail"
path = "tests/compile_fail.rs"

[[test]]
name = "cuda_event_syncpoint"
path = "tests/cuda_event_syncpoint.rs"

[[test]]
name = "error"
path = "tests/error.rs"

[[test]]
name = "error_backend_variant"
path = "tests/error_backend_variant.rs"

[[test]]
name = "gpu_resource"
path = "tests/gpu_resource.rs"

[[test]]
name = "gpu_resource_handles"
path = "tests/gpu_resource_handles.rs"

[[test]]
name = "keep_alive_mark_consumed_default"
path = "tests/keep_alive_mark_consumed_default.rs"

[[test]]
name = "pixel_format"
path = "tests/pixel_format.rs"

[[test]]
name = "pixel_format_table"
path = "tests/pixel_format_table.rs"

[[test]]
name = "shader_ids"
path = "tests/shader_ids.rs"

[[test]]
name = "sync_async"
path = "tests/sync_async.rs"

[[test]]
name = "sync_deferred_wgpu"
path = "tests/sync_deferred_wgpu.rs"
required-features = ["wgpu"]

[[test]]
name = "sync_raw_fence_carrier"
path = "tests/sync_raw_fence_carrier.rs"

[[test]]
name = "wait_deadline"
path = "tests/wait_deadline.rs"

[[test]]
name = "wait_thread"
path = "tests/wait_thread.rs"

[dependencies.ash]
version = "0.38"
optional = true
default-features = false

[dependencies.bitflags]
version = "2"

[dependencies.log]
version = "0.4"

[dependencies.parking_lot]
version = "0.12"
features = ["arc_lock"]

[dependencies.serde]
version = "1"
features = [
    "derive",
    "std",
]
optional = true
default-features = false

[dependencies.smallvec]
version = "1"
features = [
    "const_generics",
    "union",
]

[dependencies.static_assertions]
version = "1.1"

[dependencies.thiserror]
version = "2"

[dependencies.video-types]
version = "0.1"
default-features = false

[dependencies.wgpu]
version = "30"
optional = true
default-features = false

[dev-dependencies.pollster]
version = "1.0"

[dev-dependencies.trybuild]
version = "1"

[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dev-dependencies.wgpu]
version = "30"
features = [
    "wgsl",
    "spirv",
    "metal",
]
default-features = false

[target.'cfg(not(any(target_os = "macos", target_os = "ios")))'.dev-dependencies.wgpu]
version = "30"
features = [
    "wgsl",
    "spirv",
    "vulkan",
    "dx12",
]
default-features = false

[target.'cfg(target_family = "wasm")'.dependencies.js-sys]
version = "0.3"
optional = true

[target.'cfg(target_family = "wasm")'.dependencies.wasm-bindgen]
version = "0.2"
optional = true

[target.'cfg(target_family = "wasm")'.dependencies.web-sys]
version = "0.3.102"
features = [
    "GpuDevice",
    "GpuTexture",
    "HtmlCanvasElement",
    "HtmlImageElement",
    "HtmlVideoElement",
    "ImageBitmap",
    "ImageData",
    "OffscreenCanvas",
    "WebGl2RenderingContext",
    "WebGlTexture",
]
optional = true

[target.'cfg(target_os = "android")'.dependencies.ndk-sys]
version = "0.6"

[lints.clippy]
enum_glob_use = "warn"
needless_pass_by_value = "warn"
todo = "allow"

[lints.rust]
missing_debug_implementations = "warn"
unsafe_op_in_unsafe_fn = "warn"

[lints.rustdoc]
broken_intra_doc_links = "deny"