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: Convert WebGL1 shaders to WebGL2 #5166

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

0xFA11
Copy link
Contributor

@0xFA11 0xFA11 commented Dec 8, 2024

Launch Checklist

We are already relying on WebGL2 to WebGL1 conversion at build time (generate-shaders.ts).
However, some shaders are written in WebGL1 syntax but they should've been in WebGL2.
Removing WebGL1 Compat code in glslToTs function easily breaks maplibre because these shaders are not WebGL2 friendly atm.

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.

@0xFA11 0xFA11 changed the title fix: convert webgl1 shaders to webgl2 fix: Convert WebGL1 shaders to WebGL2 Dec 8, 2024
Copy link

codecov bot commented Dec 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.84%. Comparing base (4c0af78) to head (8def403).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5166   +/-   ##
=======================================
  Coverage   91.84%   91.84%           
=======================================
  Files         278      278           
  Lines       38336    38336           
  Branches     6714     6713    -1     
=======================================
  Hits        35211    35211           
+ Misses       2996     2995    -1     
- Partials      129      130    +1     

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

@HarelM
Copy link
Collaborator

HarelM commented Dec 9, 2024

Is there a lint rule we can add to make sure this won't happen in the future?

@0xFA11
Copy link
Contributor Author

0xFA11 commented Dec 9, 2024

Is there a lint rule we can add to make sure this won't happen in the future?

unfortunately not at the moment but I'm planning to introduce webgl2 specific integration test on puppeteer in the future when we come back with webgl2 option to test against webgl2 shader compatibility.

@HarelM
Copy link
Collaborator

HarelM commented Dec 9, 2024

I thought about a test as well, but I wasn't sure if all the types of shaders were needed to make sure all the shaders are correctly written, which can increase the CI dramatically, which I would like to avoid.
A sanity test can be helpful, but a linter is probably the right solution, but I can't find a good open source linter for glsl in npm...

@0xFA11
Copy link
Contributor Author

0xFA11 commented Dec 9, 2024

1 single additional puppeteer test case just for webgl2 sanity check wouldn't be too bad, would it? :)

@HarelM
Copy link
Collaborator

HarelM commented Dec 9, 2024

It wouldn't hurt 😁

@HarelM
Copy link
Collaborator

HarelM commented Dec 9, 2024

Let me know if you want to add it here, if not I'll merge this. THANKS!

@0xFA11
Copy link
Contributor Author

0xFA11 commented Dec 9, 2024

Let me know if you want to add it here, if not I'll merge this. THANKS!

I think we can merge this, I wouldn't add it here because currently there is no way to enforce WebGL2 only shaders, we will follow-up on our discussion over #3947 this week.

@HarelM HarelM merged commit 9a68613 into maplibre:main Dec 9, 2024
17 checks passed
@0xFA11 0xFA11 deleted the webgl2-shaders branch December 9, 2024 06:54
ibesora pushed a commit to ibesora/maplibre-gl-js that referenced this pull request Dec 10, 2024
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