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 for uninitialized UniformMatrix4f #342

Merged
merged 2 commits into from
Sep 15, 2021

Conversation

drwestco
Copy link
Contributor

UniformMatrix4f expects to be initialized with an all-zeros array, while mat4.create() creates an identity matrix. Subsequent calls to UniformMatrix4f.set with an identity matrix will become no-op as gl.uniformMatrix4fv won't be called.

Fixes #341

Launch Checklist

  • 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
  • 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
  • manually test the debug page
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the maplibre-gl-js changelog: <changelog></changelog>

UniformMatrix4f expects to be initialized with an all-zeros array, while mat4.create() creates an identity matrix. Subsequent calls to UniformMatrix4f.set with an identity matrix will become no-op as gl.uniformMatrix4fv won't be called.
@github-actions
Copy link
Contributor

github-actions bot commented Sep 15, 2021

Bundle size report:

Size Change: -5 B
Total Size Before: 194 kB
Total Size After: 194 kB

Output file Before After Change
maplibre-gl.js 185 kB 185 kB -5 B
maplibre-gl.css 9.49 kB 9.49 kB 0 B
ℹ️ View Details
Source file Before After Change
node_modules/gl-matrix/esm/vec4.js 427 B 447 B +20 B
rollup/build/tsc/render/uniform_binding.js 626 B 637 B +11 B
node_modules/gl-matrix/esm/mat4.js 2.08 kB 2.09 kB +4 B
rollup/build/tsc/style/query_utils.js 265 B 267 B +2 B
rollup/build/tsc/style/style_layer/fill_extrusion_style_layer.js 934 B 936 B +2 B
rollup/build/tsc/util/util.js 2.01 kB 2.01 kB +1 B
rollup/build/tsc/source/rtl_text_plugin.js 923 B 924 B +1 B
rollup/build/tsc/style/style_layer/circle_style_layer_properties.js 229 B 230 B +1 B
rollup/build/tsc/style/style_layer/circle_style_layer.js 551 B 552 B +1 B
rollup/build/tsc/style/style_layer/line_style_layer.js 1.02 kB 1.02 kB +1 B
rollup/build/tsc/source/tile_id.js 1.09 kB 1.09 kB +1 B
rollup/build/tsc/util/tile_request_cache.js 1.02 kB 1.02 kB -1 B
rollup/build/tsc/data/bucket/line_bucket.js 2.42 kB 2.41 kB -1 B
rollup/build/tsc/style/style_layer/fill_style_layer.js 285 B 284 B -1 B
rollup/build/tsc/data/program_configuration.js 2.61 kB 2.61 kB -2 B
rollup/build/tsc/data/bucket/circle_bucket.js 974 B 972 B -2 B
rollup/build/tsc/util/find_pole_of_inaccessibility.js 687 B 685 B -2 B
rollup/build/tsc/data/feature_index.js 1.7 kB 1.7 kB -2 B
rollup/build/tsc/data/feature_position_map.js 557 B 554 B -3 B

@wipfli
Copy link
Contributor

wipfli commented Sep 15, 2021

Very cool that you found that reverting this change fixes the problem. How did you do this?

@drwestco
Copy link
Contributor Author

Very cool that you found that reverting this change fixes the problem. How did you do this?

Trial and error, then code review of #209 - everything that could possibly be related to symbol layout + render in that change that was actually a code change and not just type signatures+formatting.

@HarelM
Copy link
Collaborator

HarelM commented Sep 15, 2021

I've reverted anything that caused a test to fail.
This didn't.
Can you please add a test for this?
Sorry to be the bad guy...

Copy link
Collaborator

@HarelM HarelM left a comment

Choose a reason for hiding this comment

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

Add unit test

Copy link
Collaborator

@HarelM HarelM left a comment

Choose a reason for hiding this comment

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

Great! Thanks!

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.0.0 - text rendered in wrong place when using text-variable-anchor
3 participants