Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[core] De-duplicate shader prelude source - #8316

Merged
jfirebaugh merged 1 commit into
masterfrom
shader-prelude
Mar 8, 2017
Merged

jfirebaugh merged 1 commit into
masterfrom
shader-prelude

Conversation

@jfirebaugh

@jfirebaugh jfirebaugh commented Mar 8, 2017 •

Copy link
Copy Markdown
Contributor
     VM SIZE                               FILE SIZE
 ++++++++++++++ GROWING                 ++++++++++++++
  +2.1% +3.38Ki [None]                  +3.18Ki  +1.9%
  +0.1% +2.41Ki __TEXT,__text           +2.41Ki  +0.1%
  +0.1%    +392 __TEXT,__gcc_except_tab    +392  +0.1%
  +0.1%     +16 __DATA,__data               +16  +0.1%

 -------------- SHRINKING               --------------
 -20.4% -22.2Ki __TEXT,__cstring        -22.2Ki -20.4%

  -0.4% -16.0Ki TOTAL                   -16.2Ki  -0.4%

Refs #8035.

Comment thread src/mbgl/programs/program.hpp Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

OpenGL supports taking multiple strings and compile them to a single shader. This could be a micro optimization (so we don't have to do string concatenation)

@kkaefer

kkaefer commented Mar 8, 2017

Copy link
Copy Markdown
Member

Another optimization we could do in this area is to run our shader source code to a pre-compiler that normalizes and minifies shaders, akin to CSS/JS minification. We've previously used https://github.com/aras-p/glsl-optimizer

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants