summaryrefslogtreecommitdiff
path: root/src/mbgl/programs/gl/line.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/programs/gl/line.cpp')
-rw-r--r--src/mbgl/programs/gl/line.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mbgl/programs/gl/line.cpp b/src/mbgl/programs/gl/line.cpp
index 58f626bf19..8a04f86a5f 100644
--- a/src/mbgl/programs/gl/line.cpp
+++ b/src/mbgl/programs/gl/line.cpp
@@ -15,9 +15,9 @@ struct ShaderSource;
template <>
struct ShaderSource<LineProgram> {
static constexpr const char* name = "line";
- static constexpr const uint8_t hash[8] = { 0x02, 0xe9, 0x14, 0x54, 0x14, 0xe4, 0xbc, 0x11 };
+ static constexpr const uint8_t hash[8] = { 0x7f, 0x8e, 0xaa, 0x53, 0x75, 0x78, 0xac, 0x2c };
static constexpr const auto vertexOffset = 30358;
- static constexpr const auto fragmentOffset = 33316;
+ static constexpr const auto fragmentOffset = 33355;
};
constexpr const char* ShaderSource<LineProgram>::name;
@@ -47,7 +47,7 @@ Backend::Create<gfx::Backend::Type::OpenGL>(const ProgramParameters& programPara
// #define scale 63.0
#define scale 0.015873016
-attribute vec4 a_pos_normal;
+attribute vec2 a_pos_normal;
attribute vec4 a_data;
uniform mat4 u_matrix;
@@ -165,11 +165,13 @@ void main() {
v_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0;
- vec2 pos = a_pos_normal.xy;
+ vec2 pos = floor(a_pos_normal * 0.5);
// x is 1 if it's a round cap, 0 otherwise
// y is 1 if the normal points up, and -1 if it points down
- mediump vec2 normal = a_pos_normal.zw;
+ // We store these in the least significant bit of a_pos_normal
+ mediump vec2 normal = a_pos_normal - 2.0 * pos;
+ normal.y = normal.y * 2.0 - 1.0;
v_normal = normal;
// these transformations used to be applied in the JS and native code bases.