refactor(core): honor canvas contexts throughout render passes#10474
refactor(core): honor canvas contexts throughout render passes#10474ibgreen-openai wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 99c2cbfdc2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| protected _render(options: LayersPassRenderOptions): RenderStats[] { | ||
| const canvasContext = this.device.canvasContext!; | ||
| const {canvasContext = this.device.canvasContext!} = options; |
There was a problem hiding this comment.
Clear views on the selected canvas framebuffer
When canvasContext is a non-default presentation context and a View has clear enabled, _render resolves that context's framebuffer here, but _drawLayers still forwards only the original target (typically null or undefined) and _drawLayersInViewport opens its clear pass with framebuffer: target. The clear consequently runs against the device's default canvas rather than the framebuffer used by the outer render pass, leaving stale color/depth in the selected canvas and potentially clearing another canvas; pass the resolved framebuffer into the per-view clear.
Useful? React with 👍 / 👎.
|
|
||
| if (this.lastPostProcessEffect) { | ||
| this._resizeRenderBuffers(); | ||
| this._resizeRenderBuffers(opts.canvasContext); |
There was a problem hiding this comment.
Resolve post-process output against the selected canvas
When a non-default canvasContext is rendered with a built-in PostProcessEffect and the canvas target is null, this only sizes the intermediate buffers from the selected context. _postRender still gives the final effect opts.target, so PostProcessEffect/ScreenPass starts its final pass with a null framebuffer, which selects the device's default canvas rather than canvasContext.getCurrentFramebuffer(); the selected canvas receives no composited output while the default canvas is overwritten.
Useful? React with 👍 / 👎.
Goal
Make deck.gl's existing render and picking passes consistently honor the active luma canvas context without introducing a multi-canvas API or changing the single-canvas default.
Changes
CanvasContextorPresentationContextin internal rendering and picking options.Review scope
Seven files; no new Deck props, canvas management, view-layout changes, widgets, or application examples. Omitting the context preserves the existing default behavior.
Validation
yarn buildyarn vitest run --project headless test/modules/core/lib/deck-picker.spec.ts test/modules/core/passes/layers-pass.spec.ts test/modules/core/passes/pick-layers-pass.spec.tsyarn test-headless --retry 1 --silent— 793 passed, 8 skipped; unrelated existing React-mount and LoadingWidget tests required their configured retry.Stack