Files
Mike-Solar 48e99e56b7 render: the M2 GPU zero-copy pipeline — wgpu 29, shared gpui device, GPU color LUTs
docs/zh/plans/render-pipeline-threads.md M2: the graph's textures stay
on the GPU from evaluation through presentation, and presentation runs
on the UI's own wgpu device.

- wgpu 25 -> 29 (naga 29) across the engine, unifying it with
  gpui_wgpu so engine textures are directly sampleable by the presenter
  (a single wgpu remains in the lockfile).
- GpuContext::adopt/install_shared: the app registers the window's
  device at startup and the render thread renders on it;
  texture_handle hands the raw Arc<wgpu::Texture> to
  SurfaceSource::Texture - zero-copy present on Linux/FreeBSD. The
  shared slot replaces an engine context that has not touched the GPU
  yet (startup-order guard) and refuses once it has.
- Texture::Gpu shares a GpuLease so clones release the registry token
  exactly once; the compositor, transitions and adjustment sweeps keep
  GPU textures end to end (no per-clip readbacks; GPU clears for
  black/generated frames).
- Color management stays on the GPU: the output node + display ICC
  chain is baked into a 65^3 3D LUT with the exact CPU reference and
  applied by the present WGSL pass (manual trilinear);
  ColorTransformJob bakes its OCIO processor the same way. Neither
  path skips color management.
- The explicit readback boundaries accept GPU textures: export
  encoder, CLI, worker shm, disk cache; CPU OpenFX already read back.
- M5 dependency: the YUV->RGB GPU pass (BT.601/709/2020 x
  limited/full) matches colormath::yuv444p16_to_rgb_f32.
- Acceptance: gpu_transfer_counters; single-clip and layered
  (multi-track + transition + adjustment) playback tests assert zero
  GPU->CPU readbacks, and the app test asserts adopted-device present
  is zero-copy. GPU tests hard-fail when OAK_REQUIRE_GPU is set (CI
  lavapipe) instead of skipping silently.
2026-09-12 20:52:17 +08:00

52 lines
2.4 KiB
TOML

[package]
name = "oak-render"
version.workspace = true
edition = "2021"
description = "Oak Video Editor render engine (Rust)"
license = "GPL-3.0-or-later"
[lib]
crate-type = ["staticlib", "rlib"]
[dependencies]
oak-core = { path = "../oak-core" }
# Direct Rust calls (single-lib unification): the decode bridge calls
# oakcodec's ffi, the node bridge calls oaknode's ffi. Both directions
# are acyclic (oakcodec → oakcore-rs/oak-ffmpeg-link; oaknode → oakcodec).
oak-codec = { path = "../oak-codec" }
oak-node = { path = "../oak-node" }
# wgpu: portable GPU backend (Metal/Vulkan/GL/DX12 in one safe API) — the
# direct replacement for the C++ liboakgl2/liboakvulkan backend plugins.
# Version 29 matches gpui_wgpu's device (M2 zero-copy present).
wgpu = "29"
# naga: GLSL → WGSL translation for the node shaders (the embedded GLSL
# stays the single source of truth, matching the C++ Vulkan backend's
# mechanical-conversion approach). Pinned to wgpu 29's naga generation;
# only the GLSL frontend and WGSL writer are compiled.
naga = { version = "29", default-features = false, features = ["glsl-in", "wgsl-out"] }
# ocio-rs: safe Rust bindings for OpenColorIO v2.5.2 — the ColorProcessor
# implementation; OCIO is never rewritten. The `bundled` feature compiles
# the vendored OpenColorIO C++ sources (cmake/ninja required); without it
# ocio-sys builds a stub (all color tests then early-return).
ocio-rs = { version = "0.2", features = ["bundled"] }
# `std::error::Error` impls for the crate-internal error enum.
thiserror = "2"
# The text layout/raster engine installed into oak-node's textbackend
# hooks (src/textengine.rs) — shared by the app and the worker pool, so
# both sides pin the same version as gpui's text system (one cosmic-text
# in the lockfile).
cosmic-text = "=0.19.0"
# M15 S1: physical-memory query for the process-pool worker-count policy
# (sysctlbyname on macOS / sysconf on Linux) in src/procpool.rs.
libc = "0.2"
# M15 S1: the render-worker NDJSON control protocol (src/ipc.rs moved here
# from oak-worker so both ends of the pipe link one copy; src/procpool.rs
# is the main-process side).
serde = { version = "1", features = ["derive"] }
serde_json = "1"
[dev-dependencies]
# oakcodec is also a plain dependency above; the dev-dependency re-entry
# used to enable oakcodec's `test-stubs` host-mocks, which no longer exist
# (single-lib unification removed the oakcore_audioparams_* C ABI calls).