Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use virtual-webgl to circumvent browser limits on WebGL contexts #2349

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Jan 24, 2025

  • Browsers often have a restriction on the number of WebGL contexts that can be created
    • e.g. Chrome on MacOS has a limit of 8
  • Use virtual-webgl to circumvent that limit. Basically it creates one context that is used for the whole page.

- Browsers often have a restriction on the number of WebGL contexts that can be created
  - e.g. Chrome on MacOS has a limit of 16
- Use virtual-webgl to circumvent that limit. Basically it creates one context that is used for the whole page.
@mofojed mofojed self-assigned this Jan 24, 2025
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

Attention: Patch coverage is 0% with 562 lines in your changes missing coverage. Please review.

Project coverage is 46.09%. Comparing base (680f015) to head (fe32d3e).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
packages/chart/src/virtual-webgl.ts 0.00% 559 Missing and 2 partials ⚠️
packages/chart/src/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2349      +/-   ##
==========================================
- Coverage   46.76%   46.09%   -0.67%     
==========================================
  Files         710      712       +2     
  Lines       39107    39671     +564     
  Branches     9773    10055     +282     
==========================================
  Hits        18288    18288              
- Misses      20808    21327     +519     
- Partials       11       56      +45     
Flag Coverage Δ
unit 46.09% <0.00%> (-0.67%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- The npm package doesn't export virtual-webgl, just virtual-webgl2
- It hasn't been updated in years anyway
@mofojed mofojed requested a review from mattrunyon January 29, 2025 14:19
@mofojed mofojed marked this pull request as ready for review January 29, 2025 14:19
Copy link
Collaborator

@mattrunyon mattrunyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add an e2e test for this?

packages/chart/src/index.ts Outdated Show resolved Hide resolved
@mofojed
Copy link
Member Author

mofojed commented Jan 29, 2025

Should we add an e2e test for this?

e2e test kind of annoying because don't have deephaven.ui in the e2e tests here so can't define the dashboard programmatically, and adding 16 plots and moving them all to be visible cycling through them will be annoyingly slow/difficult to write robustly... Hmmmmm actually I just realized I could define all the plots programmatically and then create a layout with all those plots, and have that in the data. That wouldn't be too bad...

- Added e2e tests for testing with 20 plots visible in a dashboard
- It seems to open the 20 plots correctly, but the Chromium snapshot is incorrect still...
- But for some reason it's not working in the e2e tests within Docker... ugh.
- Export it as a function and explicitly run it
  - When building production app, it wasn't working as an IIFE.
@mofojed mofojed requested a review from mattrunyon January 29, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants