Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
87e2a73
README: projects using FlyHigh, full list in docs/projects.md
MONZikWasTaken Nov 9, 2026
42134c2
Merge release into dev
MONZikWasTaken Nov 9, 2026
99d2b6c
Static protection keeps line art on pans; smoother pacing at x5, even…
MONZikWasTaken Nov 9, 2026
6e3d57f
Exact modes: a tick shows a source frame only where it lands on it
MONZikWasTaken Nov 9, 2026
a590894
ARCHITECTURE: wrap the planner paragraph
MONZikWasTaken Nov 9, 2026
cd33fd3
Tick lock: frames held to their whole number of ticks; Auto sizes by …
MONZikWasTaken Nov 9, 2026
dc67e11
v0.3.5
MONZikWasTaken Nov 9, 2026
2edbb40
Merge v0.3.5 into dev
MONZikWasTaken Nov 9, 2026
0d7ef18
Auto on the exact grid where no factor is even; the display's rate wi…
MONZikWasTaken Nov 9, 2026
d7c6667
Video mode: in-betweens on their own pair's span; CostSampler retries…
MONZikWasTaken Nov 9, 2026
9cec9df
options.md: Auto, the headroom and fill_display as they are now
MONZikWasTaken Nov 9, 2026
f52abbb
Auto: a penalty that does not lower the stall load is lifted (the sta…
MONZikWasTaken Nov 9, 2026
b77e494
v0.3.6
MONZikWasTaken Nov 9, 2026
542e290
Merge v0.3.6 into dev
MONZikWasTaken Nov 9, 2026
8dad44a
A change after a held frame is shown as drawn (animation on twos and …
MONZikWasTaken Nov 9, 2026
f4ab629
v0.3.7
MONZikWasTaken Nov 10, 2026
14beaf9
Merge v0.3.7 into dev
MONZikWasTaken Nov 10, 2026
6ef9ece
Browser module build remaps source paths
MONZikWasTaken Nov 11, 2026
d8028c1
Vulkan interop: frames from a host's own Vulkan device
MONZikWasTaken Nov 16, 2026
00fb03c
v0.4.0
MONZikWasTaken Nov 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ included at compile time, so there is one copy of every kernel for all targets.
| `gen_tex.rs` | the texture-path generator with modes (realtime, video with lookahead, cadence) that the Stream wraps |
| `gmhs.rs` | the repair stage and the cadence statistics and composite |
| `interop.rs` | Windows: a D3D11 shared texture into the Vulkan device without a copy |
| `vulkan_interop.rs` | Windows, Linux: frames from another Vulkan device through exported buffers and semaphores |
| `api.rs` | the CPU convenience: `api::Engine`, `api::Generator`, frames as bytes |

| Other crates and directories | Role |
Expand Down Expand Up @@ -278,7 +279,8 @@ Native (`examples/player`, the `interop` module):
| Piece | Does |
|---|---|
| ticks | Windows: DWM vblank timing with a PLL that keeps the phase; elsewhere the window system's frame callbacks |
| `interop::d3d11_shared_texture(engine, handle, &desc)` | a D3D11 shared texture (screen capture) into the Vulkan device without a copy, then `add_input_texture` on a session or a stream; C: `fh_session_import_d3d11` / `fh_stream_import_d3d11`. DX12 import, Vulkan external memory on Linux and IOSurface on macOS are open |
| `interop::d3d11_shared_texture(engine, handle, &desc)` | a D3D11 shared texture (screen capture) into the Vulkan device without a copy, then `add_input_texture` on a session or a stream; C: `fh_session_import_d3d11` / `fh_stream_import_d3d11`. DX12 import and IOSurface on macOS are open |
| `vulkan_interop` | a host's own Vulkan device (an emulator, a game) on the same GPU: frames in and out through buffers it exports, ordered by timeline semaphores in both directions; the engine keeps its own device and queue. C: `fh_vk_*`, `fh_stream_copy_in` / `fh_stream_copy_out` |
| presentation | the host's swapchain; the engine hands back the output texture, the host blits or composites it |

A plugin for OBS or a media framework is a native host with frames arriving as textures or buffers: the same import
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ follow semantic versioning as described in [CONTRIBUTING.md](CONTRIBUTING.md).

## [Unreleased]

## [0.4.0] - 2026-11-16

### Added

- Frames from a host's own Vulkan device (Windows, Linux): `vulkan_interop` imports buffers and semaphores the host
exports on the same GPU, `copy_in` copies a frame into an input slot after a semaphore wait and `copy_out` copies an
output slot back before a signal, with no copy through the CPU. C: `fh_engine_vulkan_interop`, `fh_vk_row_pitch`,
`fh_vk_buffer_import` / `_destroy`, `fh_vk_semaphore_import` / `_destroy`, `fh_vk_signal`, `fh_stream_copy_in` /
`fh_stream_copy_out`, `fh_session_copy_in` / `fh_session_copy_out`; C++ `fh::VkBuffer`, `fh::VkSemaphore`,
`Stream::copyIn` / `copyOut`. The engine's Vulkan device enables the external memory and semaphore extensions
whenever the adapter has them.

### Fixed

- `tools/build_web.sh` remaps source paths, so the browser module no longer carries the builder's home directory in
its panic locations.

## [0.3.7] - 2026-11-10

### Changed
Expand Down
14 changes: 8 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ members = ["crates/flyhigh-options", "crates/flyhigh-engine", "crates/flyhigh-ca
default-members = ["crates/flyhigh-options", "crates/flyhigh-engine", "crates/flyhigh-capi", "crates/flyhigh-cli", "examples/player"]

[workspace.package]
version = "0.3.7"
version = "0.4.0"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/getflyhigh/flyhigh-engine"
Expand Down
35 changes: 35 additions & 0 deletions bindings/cpp/flyhigh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@ class Stream {
}
void warmUp() { detail::check(fh_stream_warm_up(h_.get(), e_), "fh_stream_warm_up"); }
void reset() { detail::check(fh_stream_reset(h_.get()), "fh_stream_reset"); }
/// A frame from the host's Vulkan device into input slot `slot`, after `wait` reaches `value`.
void copyIn(uint32_t slot, const FhVkBuffer* b, uint32_t bytesPerRow, const FhVkSemaphore* wait = nullptr,
uint64_t value = 0) {
detail::check(fh_stream_copy_in(h_.get(), e_, slot, b, bytesPerRow, wait, value), "fh_stream_copy_in");
}
/// Output slot `out` into the host's buffer, then `signal` at `value`.
void copyOut(uint32_t out, const FhVkBuffer* b, uint32_t bytesPerRow, const FhVkSemaphore* signal = nullptr,
uint64_t value = 0) const {
detail::check(fh_stream_copy_out(h_.get(), e_, out, b, bytesPerRow, signal, value), "fh_stream_copy_out");
}
std::string report() const {
return detail::json([&](char* b, size_t n) { return fh_stream_report_json(h_.get(), b, n); }, "fh_stream_report_json");
}
Expand All @@ -221,6 +231,31 @@ class Stream {
uint32_t w_, hgt_;
};

/// Memory exported by the host's Vulkan device (fh_vk_buffer_import).
class VkBuffer {
public:
VkBuffer(const Engine& e, const FhVkMemory& m, uint64_t size) : h_(fh_vk_buffer_import(e.get(), &m, size)) {
if (!h_) throw detail::last("fh_vk_buffer_import");
}
FhVkBuffer* get() const { return h_.get(); }

private:
Handle<FhVkBuffer, fh_vk_buffer_destroy> h_;
};

/// A semaphore exported by the host's Vulkan device (fh_vk_semaphore_import).
class VkSemaphore {
public:
VkSemaphore(const Engine& e, intptr_t handle, bool timeline)
: h_(fh_vk_semaphore_import(e.get(), handle, timeline ? 1u : 0u)) {
if (!h_) throw detail::last("fh_vk_semaphore_import");
}
FhVkSemaphore* get() const { return h_.get(); }

private:
Handle<FhVkSemaphore, fh_vk_semaphore_destroy> h_;
};

/// What to present on this display tick and what to generate (ARCHITECTURE.md); milliseconds of the host's
/// monotonic clock.
class Pacer {
Expand Down
1 change: 1 addition & 0 deletions crates/flyhigh-capi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ crate-type = ["cdylib", "staticlib", "rlib"]
flyhigh-engine.workspace = true
serde_json.workspace = true
wgpu.workspace = true
anyhow.workspace = true
32 changes: 30 additions & 2 deletions crates/flyhigh-capi/include/flyhigh.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* FhStream frames with timestamps in, intervals out (fh_stream_*): the ring, the pair classifier, cadence
* FhPacer what to present on this display tick and what to generate (fh_pacer_*): pure logic, no clock
* FhGenerator the CPU convenience (fh_generator_*): source frames in, the frames to display out, in order
* Frames cross this ABI as RGBA8 bytes (width * height * 4); GPU textures come in through the interop calls
* (fh_session_import_d3d11, fh_stream_import_d3d11).
* Frames cross this ABI as RGBA8 bytes (width * height * 4); GPU frames come in through the interop calls
* (fh_session_import_d3d11, fh_stream_import_d3d11; fh_vk_* from the host's own Vulkan device).
* Single-threaded use per handle. Errors: a call returns NULL or -1 and fh_last_error() holds the message.
* Options: always start from the fh_*_options_default() struct and change what you need.
*/
Expand Down Expand Up @@ -262,6 +262,34 @@ int fh_generator_push(FhGenerator* generator, const uint8_t* rgba, size
* NULL), 0 = queue empty, -1 = error */
int fh_generator_pop(FhGenerator* generator, uint8_t* rgba, size_t cap, float* phase, int* real);

/* ---- Vulkan interop: frames from the host's own Vulkan device (Windows, Linux) ----
* The host exports memory and semaphores on the same GPU (compare its deviceUUID with fh_engine_vulkan_interop's):
* NT handles on Windows (OPAQUE_WIN32), file descriptors on Linux (OPAQUE_FD; owned by the engine once imported).
* Frames cross as RGBA8 rows of fh_vk_row_pitch(width) bytes in buffers: a dedicated allocation for a buffer with
* TRANSFER_SRC | TRANSFER_DST usage, imported with the exporter's allocation size and memory type index.
* copy_in waits on a semaphore before the engine reads the frame, copy_out signals one after the engine wrote it.
* Values: a timeline semaphore takes the value to wait for / signal (above 0); a binary one takes 0 and needs its
* signal submitted before the wait. */
typedef struct FhVkBuffer FhVkBuffer;
typedef struct FhVkSemaphore FhVkSemaphore;
typedef struct FhVkMemory {
intptr_t handle;
uint64_t allocation_size;
uint32_t memory_type_index;
} FhVkMemory;

int fh_engine_vulkan_interop(const FhEngine* engine, uint8_t* uuid); /* 1 supported (uuid: 16 bytes or NULL), 0 not, -1 */
uint32_t fh_vk_row_pitch(uint32_t width);
FhVkBuffer* fh_vk_buffer_import(const FhEngine* engine, const FhVkMemory* memory, uint64_t size);
void fh_vk_buffer_destroy(FhVkBuffer* buffer);
FhVkSemaphore* fh_vk_semaphore_import(const FhEngine* engine, intptr_t handle, uint32_t timeline);
void fh_vk_semaphore_destroy(FhVkSemaphore* semaphore); /* waits for the engine's queue */
int fh_vk_signal(const FhEngine* engine, const FhVkSemaphore* semaphore, uint64_t value); /* nothing copied */
int fh_stream_copy_in(FhStream* stream, const FhEngine* engine, uint32_t slot, const FhVkBuffer* buffer, uint32_t bytes_per_row, const FhVkSemaphore* wait, uint64_t value);
int fh_stream_copy_out(const FhStream* stream, const FhEngine* engine, uint32_t out, const FhVkBuffer* buffer, uint32_t bytes_per_row, const FhVkSemaphore* signal, uint64_t value);
int fh_session_copy_in(FhSession* session, const FhEngine* engine, uint32_t slot, const FhVkBuffer* buffer, uint32_t bytes_per_row, const FhVkSemaphore* wait, uint64_t value);
int fh_session_copy_out(const FhSession* session, const FhEngine* engine, uint32_t out, const FhVkBuffer* buffer, uint32_t bytes_per_row, const FhVkSemaphore* signal, uint64_t value);

#ifdef __cplusplus
}
#endif
Expand Down
3 changes: 3 additions & 0 deletions crates/flyhigh-capi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
//! - core.rs: `fh_engine_*` (the device), `fh_model_*`, `fh_session_*` (two frames in, one frame out)
//! - stream.rs: `fh_stream_*` (frames with timestamps in, intervals out)
//! - pacer.rs: `fh_pacer_*` (what to present on this tick, what to generate)
//! - vulkan.rs: `fh_vk_*`, `fh_*_copy_in` / `fh_*_copy_out` (frames from the host's own Vulkan device)
//! - here: `fh_generator_*`, the CPU convenience over `api::Generator`, and `fh_last_error`
mod core;
mod pacer;
mod stream;
mod vulkan;

pub use core::*;
pub use pacer::*;
pub use stream::*;
pub use vulkan::*;

use flyhigh_engine::api::{Generator, Mode, Options, OutFrame};
use flyhigh_engine::{Engine, Model};
Expand Down
Loading
Loading