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

Group descriptor sets by binding frequency #2892

Merged
merged 17 commits into from
Oct 16, 2024

Conversation

adrian-cojocaru
Copy link
Collaborator

@adrian-cojocaru adrian-cojocaru commented Oct 2, 2024

Descriptors are "pointers" to a resource (buffer, texture, sampler, etc) that are meant to be grouped in sets and bound to a pipeline to be consumed in subsequent drawing commands.
Currently the descriptors are batched in a single set and updated/bound for each drawable at render time. This PR aims to group the descriptors by update frequency (one global/layer/drawable) and reduce the overall number of binds per frame.

Copy link

github-actions bot commented Oct 3, 2024

Bloaty Results 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  -0.1%  -101Ki  -0.0% -4.53Ki    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-2892-compared-to-main.txt

Compared to d387090 (legacy)

    FILE SIZE        VM SIZE    
 --------------  -------------- 
   +28% +32.5Mi  +426% +25.4Mi    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-2892-compared-to-legacy.txt

Copy link

github-actions bot commented Oct 3, 2024

Benchmark Results ⚡

Benchmark                                                     Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------------------------------
OVERALL_GEOMEAN                                            -0.0027         -0.0025             0             0             0             0

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-2892-compared-to-main.txt

Copy link

github-actions bot commented Oct 8, 2024

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  -0.1% -7.54Ki  -0.1% -16.0Ki    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-2892-compared-to-main.txt

Copy link
Collaborator

@louwers louwers left a comment

Choose a reason for hiding this comment

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

Can you provide more context for this PR in the PR description?

@louwers
Copy link
Collaborator

louwers commented Oct 9, 2024

Thanks!

Copy link
Collaborator

@sjg-wdw sjg-wdw left a comment

Choose a reason for hiding this comment

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

Looks a bit more logically laid out now too.

@TimSylvester
Copy link
Collaborator

Looks like the only effect in Metal/GL is to change around the indexes where things are bound?

@adrian-cojocaru
Copy link
Collaborator Author

@TimSylvester In general yes. It reorders some enum values so that all layer specific ids are contiguous.

Copy link
Collaborator

@alexcristici alexcristici left a comment

Choose a reason for hiding this comment

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

Nice!

@adrian-cojocaru adrian-cojocaru merged commit b29c996 into maplibre:main Oct 16, 2024
39 checks passed
@adrian-cojocaru adrian-cojocaru deleted the layer-descriptor-sets branch October 18, 2024 11:49
@louwers louwers mentioned this pull request Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants