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

Metal stats #1781

Merged
merged 12 commits into from
Oct 20, 2023
Merged

Metal stats #1781

merged 12 commits into from
Oct 20, 2023

Conversation

TimSylvester
Copy link
Collaborator

Adds stats tracking for Metal and more stats.
Shares the attribute buffer bound when properties come from the uniforms (which is needed to avoid validation errors).

The result of a benchmark run:

numFrames = 2112
numDrawCalls = 412
totalDrawCalls = 3678
numCreatedTextures = 238
numActiveTextures = 0
numTextureBindings = 0
numTextureUpdates = 503
textureUpdateBytes = 20577531
numBuffers = 0
numFrameBuffers = 0
numIndexBuffers = 0
indexUpdateBytes = 0
numVertexBuffers = 0
vertexUpdateBytes = 0
numUniformBuffers = 0
numUniformUpdates = 1605001
uniformUpdateBytes = 100406080
memTextures = 0
memBuffers = 0
memIndexBuffers = 0
memVertexBuffers = 0
memUniformBuffers = 0
stencilClears = 0
stencilUpdates = 3678

Collect stats from Metal buffers, textures, etc.
Eliminate buffer copy constructors to make buffer copies explicit.
Fix buffer stats accounting on move assignment.
Fix texture stats accounting on deallocate.
Dump stats to log output in debug builds.
Share dummy buffer for unused attributes.
# Conflicts:
#	include/mbgl/mtl/context.hpp
#	src/mbgl/mtl/context.cpp
#	src/mbgl/renderer/paint_parameters.cpp
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.

Wow, those buffer updates.

@TimSylvester
Copy link
Collaborator Author

Sorry, this should have been a draft. The GL config should work now...

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (4b76f79) 85.75% compared to head (44656ae) 85.74%.
Report is 1 commits behind head on main.

❗ Current head 44656ae differs from pull request most recent head 3205452. Consider uploading reports for the commit 3205452 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1781      +/-   ##
==========================================
- Coverage   85.75%   85.74%   -0.02%     
==========================================
  Files         566      566              
  Lines       27812    27863      +51     
==========================================
+ Hits        23851    23891      +40     
- Misses       3961     3972      +11     
Files Coverage Δ
include/mbgl/gfx/rendering_stats.hpp 100.00% <ø> (ø)
src/mbgl/gfx/context.hpp 100.00% <100.00%> (ø)
src/mbgl/gl/context.cpp 80.37% <100.00%> (+0.05%) ⬆️
src/mbgl/gl/context.hpp 100.00% <ø> (ø)
src/mbgl/renderer/paint_parameters.cpp 90.40% <ø> (ø)
src/mbgl/renderer/render_orchestrator.cpp 90.42% <100.00%> (ø)
src/mbgl/gfx/rendering_stats.cpp 71.42% <72.22%> (-28.58%) ⬇️

... and 3 files with indirect coverage changes

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

@github-actions
Copy link

Size test result

Old size: 8674624 bytes
New size: 8674432 bytes
Difference: +0.00%

@github-actions
Copy link

github-actions bot commented Oct 20, 2023

Bloaty Results 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0% +2.69Ki  +0.0%    +476    TOTAL

Full report: bloaty-results/pr-1781-compared-to-main.txt
Compared to d387090 (legacy)

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +3.2% +3.67Mi   +12%  +737Ki    TOTAL

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

@TimSylvester TimSylvester merged commit 1a1c826 into main Oct 20, 2023
22 of 33 checks passed
@TimSylvester TimSylvester deleted the metal-stats branch October 20, 2023 22:45
@TimSylvester TimSylvester mentioned this pull request Oct 23, 2023
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