DioxusLabs / DioxusLabs/anyrender

Add frame outcome result to WindowRenderer::render

Open
#67 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
106
Forks
31
Avg merge
2h 8m
Merged PRs (30d)
11

Description

`WindowRenderer::render` currently returns `()`, so callers cannot tell whether a frame actually reached the window.

For retained or damage-driven apps, that makes it hard to commit paint state correctly: the draw callback may run, but the backend can still fail to acquire, submit, swap, or present the frame afterward.

Would AnyRender be open to a backend-neutral frame outcome API?

```rust
pub enum FrameOutcome {
Presented,
NotReady,
TargetUnavailable,
SurfaceLost,
SurfaceOutdated,
Timeout,
RenderFailed,
SubmitFailed,
PresentFailed,
}
```
The goal is not app-specific dirty tracking. It is exposing renderer/window lifecycle truth so hosts can decide whether to retry.

This would help across backends:

- Vello/WebGPU: surface acquisition, render, submit, present failures
- Skia: surface/context/flush/swap failures
- pixels/softbuffer-style backends: present or target-unavailable states
- Blitz/content renderers: can rely on AnyRender for lifecycle instead of building a parallel model

Desired semantics:

- If no target/surface is available, return without calling the draw callback.
- If drawing runs but the frame does not present, report the failure.
- Presented means the backend believes the frame reached the window/surface.
- Existing fire-and-forget callers could ignore the result.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing WindowRenderer::render through the Vello/WebGPU, Skia, pixels/softbuffer-style, and Blitz/content renderer backends mentioned in the issue. Define how each backend maps acquisition, drawing, submission, swapping, and presentation failures to FrameOutcome, while preserving fire-and-forget callers. Done means unavailable targets skip drawing, failed presentation is reported, and successful presentation returns Presented.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design, computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.