Skip to content

Use Compose WebGL render targets - #1114

Draft
sargunv wants to merge 6 commits into
mainfrom
codex/integrate-compose-webgl-render-target
Draft

Use Compose WebGL render targets#1114
sargunv wants to merge 6 commits into
mainfrom
codex/integrate-compose-webgl-render-target

Conversation

@sargunv

@sargunv sargunv commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Description

Uses Compose UI's WebGLRenderTarget instead of the browser Skiko/Emscripten bridge. MapLibre keeps framebuffer sizing, repaint scheduling, and sampler cleanup; Compose owns the target and restores its graphics state.

The pinned Compose 1.12.10-alpha01+dev4710 build includes the required API and resize fix. Its Skiko 0.152.0-alpha02 runtime also requires the desktop host to read GPU contexts from backend redrawers. The Windows host verifies its native device offsets against that version (resolves #1312).

The branch is updated for current main's initialization, logging, test fixtures, and CI tiers. GPU tests exercise MapLibre's framebuffer behavior without retaining a test-only copy of the removed texture bridge. The shared-image composition test now initializes a Compose graphics host.

Validation

mise run test:js, mise run test:desktop on macOS, and mise run check pass. The browser compile used a local 6 GB Kotlin daemon heap and reduced build concurrency after exhausting the default 2 GB heap. The desktop suite reports seven skipped tests. The JS demo renders through shrinking and growing Chromium viewports without page errors.

CI is pending on the updated head. Full platform coverage is requested because the revised Skiko native device layout and redrawer integration affect Windows ARM64 and Linux ARM64 as well as the default desktop variants.

Release dependency

Remains a draft for a future release. The Compose development build includes upstream #3323 and #3344; the release gate remains a non-prerelease Compose version containing the required APIs. Kotlin/Wasm support is stacked in #1081.

AI assistance

OpenAI Codex (GPT-6) implemented, rebased, reviewed, and validated the change under human direction.

@sargunv sargunv added blocked-upstream This issue can't be resolved until an upstream issue is resolved web Affects Web in particular, or relates to Web specific code labels Aug 26, 2026
eymar pushed a commit to JetBrains/compose-multiplatform-core that referenced this pull request Aug 27, 2026
Fix `WebGLRenderTarget` rendering after its size changes.

`Image.adoptTextureFrom` transfers ownership of the WebGL texture to
Skia, so closing the old image deletes that texture. The previous resize
path then tried to allocate storage on the deleted texture, which left
the framebuffer incomplete. This change creates a texture for each size
generation and releases the previous texture through one path after
notifying borrowers.

PR #3323 and its Skiko update are now on `jb-main`. This PR is the
focused resize follow-up.

## Testing

In this repo:

- `./gradlew :compose:ui:ui:jsBrowserTest --no-daemon
--no-configuration-cache`
- `./gradlew :mpp:publishComposeJbToMavenLocal -Pcompose.platforms=web
-Pjetbrains.publication.libraries=COMPOSE --no-daemon
--no-configuration-cache`

In maplibre/maplibre-compose#1114:

- MapLibre Compose demo startup and resize in Chromium, Safari, and
Firefox.
- MapLibre Compose JS browser suite: 204 tests, no failures or skips.


## Release Notes
N/A
@sargunv
sargunv temporarily deployed to cloudflare-pages August 27, 2026 19:26 — with GitHub Actions Inactive
@sargunv
sargunv force-pushed the codex/integrate-compose-webgl-render-target branch from b1eb9e5 to 2e75565 Compare August 27, 2026 21:11
@sargunv
sargunv temporarily deployed to cloudflare-pages August 27, 2026 21:12 — with GitHub Actions Inactive
@sargunv
sargunv temporarily deployed to cloudflare-pages August 27, 2026 23:52 — with GitHub Actions Inactive
@sargunv
sargunv temporarily deployed to cloudflare-pages August 28, 2026 00:30 — with GitHub Actions Inactive
@sargunv
sargunv temporarily deployed to cloudflare-pages August 28, 2026 00:48 — with GitHub Actions Inactive
@cursor
cursor Bot force-pushed the codex/integrate-compose-webgl-render-target branch from 3173bed to 3044129 Compare August 29, 2026 04:03
@cursor
cursor Bot temporarily deployed to cloudflare-pages August 29, 2026 04:03 Inactive
@cursor
cursor Bot temporarily deployed to cloudflare-pages August 29, 2026 04:45 Inactive
sargunv and others added 6 commits September 7, 2026 01:18
The mutable 1.12.10-alpha01+snapshot.default pin can be replaced: JetBrains
now publishes +dev4710, which includes WebGLRenderTarget from Compose #3323
and the resize fix from #3344.

Co-authored-by: github.boned427 <github.boned427@passmail.net>
The 1.12.10-alpha01+dev4710 iOS metadata still links against
Xcode_26.2_Universal.app, which is not installed on the macos-26 runner.

Co-authored-by: github.boned427 <github.boned427@passmail.net>
@sargunv
sargunv force-pushed the codex/integrate-compose-webgl-render-target branch from a83ebc8 to 3d3cc60 Compare September 7, 2026 08:34
@sargunv sargunv added the ci:full Run every CI platform on this PR, including drafts and ARM64 desktop label Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked-upstream This issue can't be resolved until an upstream issue is resolved ci:full Run every CI platform on this PR, including drafts and ARM64 desktop web Affects Web in particular, or relates to Web specific code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for skiko 0.152.0-alpha03+

2 participants