diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-03-08 08:55:55 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-03-08 13:49:24 -0800 |
commit | b83b14feb0b99d669fb84a52ab356051368de637 (patch) | |
tree | adc86e0e415db7d7f0371471e1d3fe4b95146968 /src/mbgl/programs/program.hpp | |
parent | 84aac92b4eaf264de66c07b98e267364e34e14f0 (diff) | |
download | qtlocation-mapboxgl-b83b14feb0b99d669fb84a52ab356051368de637.tar.gz |
[core] De-duplicate shader prelude source
Diffstat (limited to 'src/mbgl/programs/program.hpp')
-rw-r--r-- | src/mbgl/programs/program.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mbgl/programs/program.hpp b/src/mbgl/programs/program.hpp index e75dbebf18..ffad767c3a 100644 --- a/src/mbgl/programs/program.hpp +++ b/src/mbgl/programs/program.hpp @@ -4,6 +4,7 @@ #include <mbgl/programs/program_parameters.hpp> #include <mbgl/programs/attributes.hpp> #include <mbgl/style/paint_property.hpp> +#include <mbgl/shaders/preludes.hpp> #include <sstream> #include <cassert> @@ -45,7 +46,7 @@ public: } static std::string fragmentSource(const ProgramParameters& parameters) { - std::string source = pixelRatioDefine(parameters) + Shaders::fragmentSource; + std::string source = pixelRatioDefine(parameters) + shaders::fragmentPrelude + Shaders::fragmentSource; if (parameters.overdraw) { assert(source.find("#ifdef OVERDRAW_INSPECTOR") != std::string::npos); source.replace(source.find_first_of('\n'), 1, "\n#define OVERDRAW_INSPECTOR\n"); @@ -54,7 +55,7 @@ public: } static std::string vertexSource(const ProgramParameters& parameters) { - return pixelRatioDefine(parameters) + Shaders::vertexSource; + return pixelRatioDefine(parameters) + shaders::vertexPrelude + Shaders::vertexSource; } template <class DrawMode> |