-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
GPU Expressions #2202
GPU Expressions #2202
Conversation
Bloaty Results (iOS) 🐋Compared to main
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-2202-compared-to-main.txt |
6cf2a67
to
1b195e5
Compare
Bloaty Results 🐋Compared to main
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-2202-compared-to-main.txtCompared to d387090 (legacy)
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-2202-compared-to-legacy.txt |
5681621
to
dba57fa
Compare
4fc8155
to
10a4b7c
Compare
Benchmark Results ⚡
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-2202-compared-to-main.txt |
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.
Looks good to me.
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.
The pre-commit hook tried to format the code, but it could not push because the fork is owned by an organization. You can run pre-commit locally with:
pre-commit run --all-files
Could you update the PR description to include a description of the changes made to the iOS Benchmark app?
The PR title could be a bit more descriptive. This is not the first PR on GPU Expressions, and I am assuming it won't be the last. If you hover over a piece of code or use git blame
it's nice to get a short description with a summary to know as part of what effort the code in question was added.
A few more details about the implementation and the reason behind them in the description would also be appreciated. Each PR should ideally have a self-contained description of the changes.
Other than that, code looks good. Thanks!
@louwers I have |
@TimSylvester Sure. I'll make a PR. Edit: I don't see any changes to |
Updated benchmark, pretty much the same. CPU:
GPU:
So, a small hit in render time with no real benefit to encoding time. The CPU work we're avoiding is not very costly, and we can't avoid updating and binding the evaluated property UBO unless every single property could be done on the GPU. |
We would like to eventually move as much of the style property evaluation as is practical to the shaders. This sets up some foundational aspects of that and allows basic zoom-based expressions in line layers to be evaluated in shaders.
The legacy code used uniforms for these same zoom-based expressions, updating them on each frame. Unfortunately, the entire UBO still needs to be updated if any of the properties are CPU-evaluated, so we don't really gain any efficiency from the binding or data transfer. We skip some of the actual property evaluation, but that barely shows up in profiling.
To be really beneficial, we will need to get to the point where we can use shaders for per-attribute expressions, so that the much larger vertex attribute arrays do not need to be updated constantly. That will involve making the feature data available to the shaders with some pre-processing.
Currently only applies to non-custom line layers.