-
-
Notifications
You must be signed in to change notification settings - Fork 705
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
Skip creating textures for empty atlases #2297
base: main
Are you sure you want to change the base?
Conversation
Thanks for taking the time to open this PR!! |
Initialization of the Regarding tests, I'm unfamiliar with MapLibre's test scaffolding. I'm not sure if it's even possible to run an automated puppeteer/karma/whatever browser test on a headless Firefox instance and check for WebGL warnings in the console. |
...and of course the unit tests assume that there are atlas images and textures for every tile, despite the
|
There are browser tests, but I agree FF is problematic here. Unit tests would be enough at this point. |
47b9c9b
to
33dc7fe
Compare
33dc7fe
to
ceb5956
Compare
The changes impact the behaviour of one specific render test: extrusion pattern with missing texture. The current expectation is a transparent image, but removing the texture (and running the shader with no bound texture) creates a black extrusion. @HarelM Would this change in behaviour be OK? Otherwise it'd be possible to create an empty transparent texture just for this edge case. |
Can you fix the test so that I can see the change in the image? |
The code you added is fairly simple and I don't see big issues with it. |
So the problematic render test is For reference, most of ...except for After my changes, that specific render test looks like: ...this difference happens because, before this PR, tiles with no image atlas would allocate a transparent 1x1 texture - drawing an extrusion pattern with an invalid image would use that transparent 1x1 texture. Since this PR skips the creation of those empty textures, the shader uses no texture - and the texture sampler somehow defaults to solid black. Hope that helps? |
Yes, it does! Sorry for the delay in response. |
Please add unit test to cover the new functionality (besides fixing the render tests). |
Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
ceb5956
to
4e7de58
Compare
@@ -29,6 +30,9 @@ | |||
- Fix geolocate control permissions failure on IOS16 web view with fallback to `window.navigator.geolocation` | |||
- _...Add new stuff here..._ | |||
|
|||
### ⚠️ Note on missing images |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add that as part of the above item with a [Breaking] prefix, feel free to add the emoji to the other breaking items as well.
Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
Bummer, we didn't add it to version 3. :-( |
This is the PR that added I would say that trasparent texture is intended behaviour |
Indirectly fixes most of the deprecation warnings from #2030.
By making the tile worker return
undefined
instead of empty 1x1 atlases, the main thread skips creating textures for those. Those empty textures were the source of most of the WebGL warnings, AFAICS.Launch Checklist
CHANGELOG.md
under the## main
section.