diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-03-19 14:02:10 +0100 |
---|---|---|
committer | Alf Watt <alf.watt@mapbox.com> | 2019-03-21 12:25:11 -0700 |
commit | bf9e76c1cb2f6b0e1f6bc824d5c2d822595158b7 (patch) | |
tree | e88f9a2ffc25f8cac58382dec234b8023ed023c8 /src/mbgl/programs/gl/hillshade.cpp | |
parent | 19d70f5be90fdf1e269b99f0a9e253dcca839cf9 (diff) | |
download | qtlocation-mapboxgl-bf9e76c1cb2f6b0e1f6bc824d5c2d822595158b7.tar.gz |
[core] move ProgramMap to within the gl::Program object
Diffstat (limited to 'src/mbgl/programs/gl/hillshade.cpp')
-rw-r--r-- | src/mbgl/programs/gl/hillshade.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/mbgl/programs/gl/hillshade.cpp b/src/mbgl/programs/gl/hillshade.cpp index dcf90f1149..a33ddb4326 100644 --- a/src/mbgl/programs/gl/hillshade.cpp +++ b/src/mbgl/programs/gl/hillshade.cpp @@ -1,18 +1,37 @@ // NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. #include <mbgl/programs/hillshade_program.hpp> +#include <mbgl/programs/gl/preludes.hpp> #include <mbgl/programs/gl/shader_source.hpp> #include <mbgl/gl/program.hpp> namespace mbgl { +namespace programs { +namespace gl { + +template <typename> +struct ShaderSource; + +template <> +struct ShaderSource<HillshadeProgram> { + static constexpr const char* name = "hillshade"; + static constexpr const uint8_t hash[8] = { 0x8a, 0x11, 0x29, 0x18, 0x52, 0x7f, 0x3b, 0xbb }; + static constexpr const auto vertexOffset = 29340; + static constexpr const auto fragmentOffset = 29511; +}; + +constexpr const char* ShaderSource<HillshadeProgram>::name; +constexpr const uint8_t ShaderSource<HillshadeProgram>::hash[8]; + +} // namespace gl +} // namespace programs + namespace gfx { template <> std::unique_ptr<Program<HillshadeProgram>> Context::createProgram<gl::Context>(const ProgramParameters& programParameters) { - return gl::Program<HillshadeProgram>::createProgram( - reinterpret_cast<gl::Context&>(*this), programParameters, "hillshade", - programs::gl::shaderSource() + 29340, programs::gl::shaderSource() + 29511); + return std::make_unique<gl::Program<HillshadeProgram>>(programParameters); } } // namespace gfx |