all-is-cubes-gpu 0.7.0

Optional GPU rendering implementation for the all-is-cubes crate.
Documentation
[package]
name = "all-is-cubes-gpu"
version = "0.7.0"
authors = ["Kevin Reid <kpreid@switchb.org>"]
edition = "2021"
rust-version = "1.65"
description = "Optional GPU rendering implementation for the all-is-cubes crate."
# TODO: add homepage = "..." when we have one
repository = "https://github.com/kpreid/all-is-cubes"
license = "MIT OR Apache-2.0"
# TODO: revisit categories once it's more settled how useful this is as an engine
categories = ["games", "graphics", "rendering", "rendering::engine"]

[package.metadata.docs.rs]
all-features = true

[lib]
# Disable running as benchmark so that the default doesn't interfere with Criterion usage.
bench = false
# Disable doctest running to reduce total noise in `cargo test` output.
# Doctests are so slow, and not well applicable here, so we don't currently have any.
doctest = false

[[test]]
name = "shaders"
required-features = ["wgpu"]

[[bench]]
name = "wgpu_bench"
harness = false

[features]
# Adds support for render info logging to Rerun.
rerun = ["all-is-cubes/rerun", "all-is-cubes-mesh/rerun"]
# Enable wgpu support.
# (The library is useless without this, but we used to have multiple GPU API support
# and I don't want to go entirely deleting it quite yet.)
wgpu = ["dep:wgpu"]
# Enable use of threads.
threads = ["dep:rayon"]

[dependencies]
all-is-cubes = { path = "../all-is-cubes", version = "0.7.0" }
all-is-cubes-mesh = { path = "../all-is-cubes-mesh", version = "0.7.0" }
bytemuck = { workspace = true, features = ["derive"] }
cfg-if = { workspace = true }
# Used to implement ensure_polled(). Also a `wgpu` dependency already.
flume = { workspace = true }
futures-channel = { workspace = true, features = ["sink"] }
futures-core = { workspace = true }
futures-util = { workspace = true, features = [
    "async-await", # needed for select!
    "async-await-macro", # needed for select!
    "std", # needed for select!
    "sink"
] }
# f16 support for working with floating point textures.
half = { version = "2.3.1", features = ["bytemuck"] }
itertools = { workspace = true }
log = { workspace = true }
once_cell = { workspace = true }
# Used to implement ensure_polled on non-Wasm targets, and in the `rerun` support.
pollster = { workspace = true }
rand = { workspace = true }
rand_xoshiro = { workspace = true }
rayon = { workspace = true, optional = true }
resource = "0.5.0"
thiserror = { workspace = true }
wasm-bindgen-futures = { workspace = true }
# For initializing tests on web. (This is not a dev-dependency because some of said tests are not in this package.)
web-sys = { version = "0.3.67", features = ["OffscreenCanvas"] }
web-time = { workspace = true }
wgpu = { workspace = true, optional = true }

[target.'cfg(target_family = "wasm")'.dependencies]
# Used in the `poll` module to implement timeout
gloo-timers = { version = "0.3.0", default-features = false, features = ["futures"]}
# If we don't set this feature, it will try to access files at run time and fail
# since web wasm has no std::fs.
resource = { version = "0.5.0", features = ["force-static"] }
wgpu = { workspace = true, optional = true }

[dev-dependencies]
criterion = { workspace = true, features = ["async_tokio"] }
# Used in shader tests. TODO: Not really necessary
image = { workspace = true }
# Using tokio for async test-running.
tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread", "parking_lot", "sync"] }


[lints]
workspace = true