[core] use constexpr string concatenation for uniform/attribute names

This commit is contained in:
Konstantin Käfer
2019-03-19 14:02:10 +01:00
parent 0ad2375e10
commit 53ab65d811
27 changed files with 621 additions and 533 deletions

View File

@@ -23,6 +23,11 @@ function basicMinify(src) {
}
for (const key in shaders) {
// Rename a_*_t uniforms to u_*_t. This is a workaround until we can use
// https://github.com/mapbox/mapbox-gl-js/pull/8055, which is blocked by
// https://github.com/mapbox/mapbox-gl-native/issues/13984
shaders[key].vertexSource = shaders[key].vertexSource.replace(/\ba_(\w+)_t\b/mg, 'u_$1_t');
const vertex = concatenated.length;
concatenated += basicMinify(shaders[key].vertexSource);
concatenated += '\n\0';