diff options
Diffstat (limited to 'src/mbgl/programs/gl/background.cpp')
-rw-r--r-- | src/mbgl/programs/gl/background.cpp | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/src/mbgl/programs/gl/background.cpp b/src/mbgl/programs/gl/background.cpp index f3d2cdfd90..aacc4b2886 100644 --- a/src/mbgl/programs/gl/background.cpp +++ b/src/mbgl/programs/gl/background.cpp @@ -15,30 +15,7 @@ struct ShaderSource; template <> struct ShaderSource<BackgroundProgram> { static constexpr const char* name = "background"; - static constexpr const uint8_t hash[8] = { 0x2d, 0xef, 0x97, 0xa2, 0xec, 0xb5, 0x67, 0xef }; - static constexpr const auto vertexOffset = 1429; - static constexpr const auto fragmentOffset = 1525; -}; - -constexpr const char* ShaderSource<BackgroundProgram>::name; -constexpr const uint8_t ShaderSource<BackgroundProgram>::hash[8]; - -} // namespace gl -} // namespace programs - -namespace gfx { - -template <> -std::unique_ptr<gfx::Program<BackgroundProgram>> -Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) { - return std::make_unique<gl::Program<BackgroundProgram>>(programParameters); -} - -} // namespace gfx -} // namespace mbgl - -// Uncompressed source of background.vertex.glsl: -/* + static constexpr const char* vertexSource = R"MBGL_SHADER( attribute vec2 a_pos; uniform mat4 u_matrix; @@ -47,10 +24,8 @@ void main() { gl_Position = u_matrix * vec4(a_pos, 0, 1); } -*/ - -// Uncompressed source of background.fragment.glsl: -/* +)MBGL_SHADER"; + static constexpr const char* fragmentSource = R"MBGL_SHADER( uniform vec4 u_color; uniform float u_opacity; @@ -62,5 +37,23 @@ void main() { #endif } -*/ +)MBGL_SHADER"; +}; + +constexpr const char* ShaderSource<BackgroundProgram>::name; +constexpr const char* ShaderSource<BackgroundProgram>::vertexSource; +constexpr const char* ShaderSource<BackgroundProgram>::fragmentSource; + +} // namespace gl +} // namespace programs + +namespace gfx { +template <> +std::unique_ptr<gfx::Program<BackgroundProgram>> +Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programParameters) { + return std::make_unique<gl::Program<BackgroundProgram>>(programParameters); +} + +} // namespace gfx +} // namespace mbgl |