diff --git a/package.json b/package.json index 3552a8533..cd06121f3 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,9 @@ "csscolorparser": "^1.0.2", "ejs": "^2.4.1", "express": "^4.11.1", - "mapbox-gl-shaders": "mapbox/mapbox-gl-shaders#4d1f89514bf03536c8e682439df165c33a37122a", + "mapbox-gl-shaders": "mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747", "mapbox-gl-style-spec": "mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae", - "mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#8e38705747dee1279a8503d05593543eb9af3ce1", + "mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#1619d84e76ff3434becd51237720d370c7405ee5", "node-cmake": "^1.2.1", "request": "^2.72.0", "tape": "^4.5.1" diff --git a/src/mbgl/geometry/collision_box_buffer.cpp b/src/mbgl/geometry/collision_box_buffer.cpp index a47267d56..291c5234e 100644 --- a/src/mbgl/geometry/collision_box_buffer.cpp +++ b/src/mbgl/geometry/collision_box_buffer.cpp @@ -17,7 +17,7 @@ size_t CollisionBoxVertexBuffer::add(int16_t x, int16_t y, float ox, float oy, f shorts[3] /* offset */ = ::round(oy); uint8_t *ubytes = static_cast(data); - // a_data1 + // a_data ubytes[8] = maxzoom * 10; ubytes[9] = placementZoom * 10; diff --git a/src/mbgl/geometry/icon_buffer.cpp b/src/mbgl/geometry/icon_buffer.cpp index 51a4aa69f..2895ca5c3 100644 --- a/src/mbgl/geometry/icon_buffer.cpp +++ b/src/mbgl/geometry/icon_buffer.cpp @@ -16,16 +16,18 @@ size_t IconVertexBuffer::add(int16_t x, int16_t y, float ox, float oy, int16_t t shorts[2] /* offset */ = ::round(ox * 64); // use 1/64 pixels for placement shorts[3] /* offset */ = ::round(oy * 64); - uint8_t *ubytes = static_cast(data); - // a_data1 - ubytes[8] /* tex */ = tx / 4; - ubytes[9] /* tex */ = ty / 4; - ubytes[10] /* labelminzoom */ = labelminzoom * 10; - ubytes[11] /* labelangle */ = labelangle; + uint16_t *ushorts = static_cast(data); + // a_texture_pos + ushorts[4] /* tex */ = tx / 4; + ushorts[5] /* tex */ = ty / 4; - // a_data2 - ubytes[12] /* minzoom */ = minzoom * 10; // 1/10 zoom levels: z16 == 160. - ubytes[13] /* maxzoom */ = ::fmin(maxzoom, 25) * 10; // 1/10 zoom levels: z16 == 160. + uint8_t *ubytes = static_cast(data); + // a_data + ubytes[12] /* labelminzoom */ = labelminzoom * 10; + ubytes[13] /* labelangle */ = labelangle; + + ubytes[14] /* minzoom */ = minzoom * 10; // 1/10 zoom levels: z16 == 160. + ubytes[15] /* maxzoom */ = ::fmin(maxzoom, 25) * 10; // 1/10 zoom levels: z16 == 160. return idx; } diff --git a/src/mbgl/geometry/text_buffer.cpp b/src/mbgl/geometry/text_buffer.cpp index 382e87324..56f1c402d 100644 --- a/src/mbgl/geometry/text_buffer.cpp +++ b/src/mbgl/geometry/text_buffer.cpp @@ -16,18 +16,21 @@ size_t TextVertexBuffer::add(int16_t x, int16_t y, float ox, float oy, uint16_t shorts[2] /* offset */ = ::round(ox * 64); // use 1/64 pixels for placement shorts[3] /* offset */ = ::round(oy * 64); - uint8_t *ubytes = static_cast(data); - // a_data1 - ubytes[8] /* tex */ = tx / 4; - ubytes[9] /* tex */ = ty / 4; - ubytes[10] /* labelminzoom */ = labelminzoom * 10; - ubytes[11] /* labelangle */ = labelangle; + uint16_t *ushorts = static_cast(data); + // a_texture_pos + ushorts[4] /* tex */ = tx / 4; + ushorts[5] /* tex */ = ty / 4; - // a_data2 - ubytes[12] /* minzoom */ = minzoom * 10; // 1/10 zoom levels: z16 == 160. - ubytes[13] /* maxzoom */ = ::fmin(maxzoom, 25) * 10; // 1/10 zoom levels: z16 == 160. + uint8_t *ubytes = static_cast(data); + // a_data + ubytes[12] /* labelminzoom */ = labelminzoom * 10; + ubytes[13] /* labelangle */ = labelangle; + + ubytes[14] /* minzoom */ = minzoom * 10; // 1/10 zoom levels: z16 == 160. + ubytes[15] /* maxzoom */ = ::fmin(maxzoom, 25) * 10; // 1/10 zoom levels: z16 == 160. return idx; } } // namespace mbgl + diff --git a/src/mbgl/shader/icon_shader.cpp b/src/mbgl/shader/icon_shader.cpp index d91fbe2ec..148cf3004 100644 --- a/src/mbgl/shader/icon_shader.cpp +++ b/src/mbgl/shader/icon_shader.cpp @@ -21,11 +21,11 @@ void IconShader::bind(GLbyte* offset) { MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_offset)); MBGL_CHECK_ERROR(glVertexAttribPointer(a_offset, 2, GL_SHORT, false, stride, offset + 4)); - MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_data1)); - MBGL_CHECK_ERROR(glVertexAttribPointer(a_data1, 4, GL_UNSIGNED_BYTE, false, stride, offset + 8)); + MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_texture_pos)); + MBGL_CHECK_ERROR(glVertexAttribPointer(a_texture_pos, 2, GL_UNSIGNED_SHORT, false, stride, offset + 8)); - MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_data2)); - MBGL_CHECK_ERROR(glVertexAttribPointer(a_data2, 4, GL_UNSIGNED_BYTE, false, stride, offset + 12)); + MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_data)); + MBGL_CHECK_ERROR(glVertexAttribPointer(a_data, 4, GL_UNSIGNED_BYTE, false, stride, offset + 12)); } } // namespace mbgl diff --git a/src/mbgl/shader/sdf_shader.cpp b/src/mbgl/shader/sdf_shader.cpp index 24b6f77d6..5de68e0e4 100644 --- a/src/mbgl/shader/sdf_shader.cpp +++ b/src/mbgl/shader/sdf_shader.cpp @@ -21,11 +21,11 @@ void SDFShader::bind(GLbyte* offset) { MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_offset)); MBGL_CHECK_ERROR(glVertexAttribPointer(a_offset, 2, GL_SHORT, false, stride, offset + 4)); - MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_data1)); - MBGL_CHECK_ERROR(glVertexAttribPointer(a_data1, 4, GL_UNSIGNED_BYTE, false, stride, offset + 8)); + MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_texture_pos)); + MBGL_CHECK_ERROR(glVertexAttribPointer(a_texture_pos, 2, GL_UNSIGNED_SHORT, false, stride, offset + 8)); - MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_data2)); - MBGL_CHECK_ERROR(glVertexAttribPointer(a_data2, 4, GL_UNSIGNED_BYTE, false, stride, offset + 12)); + MBGL_CHECK_ERROR(glEnableVertexAttribArray(a_data)); + MBGL_CHECK_ERROR(glVertexAttribPointer(a_data, 4, GL_UNSIGNED_BYTE, false, stride, offset + 12)); } } // namespace mbgl diff --git a/src/mbgl/shader/shader.cpp b/src/mbgl/shader/shader.cpp index ae36d2174..34813ac7d 100644 --- a/src/mbgl/shader/shader.cpp +++ b/src/mbgl/shader/shader.cpp @@ -48,8 +48,6 @@ Shader::Shader(const char* name_, const char* vertexSource, const char* fragment MBGL_CHECK_ERROR(glBindAttribLocation(program.get(), a_extrude, "a_extrude")); MBGL_CHECK_ERROR(glBindAttribLocation(program.get(), a_offset, "a_offset")); MBGL_CHECK_ERROR(glBindAttribLocation(program.get(), a_data, "a_data")); - MBGL_CHECK_ERROR(glBindAttribLocation(program.get(), a_data1, "a_data1")); - MBGL_CHECK_ERROR(glBindAttribLocation(program.get(), a_data2, "a_data2")); MBGL_CHECK_ERROR(glBindAttribLocation(program.get(), a_texture_pos, "a_texture_pos")); // Link program diff --git a/src/mbgl/shader/shader.hpp b/src/mbgl/shader/shader.hpp index f7da0c91a..620e8f136 100644 --- a/src/mbgl/shader/shader.hpp +++ b/src/mbgl/shader/shader.hpp @@ -34,9 +34,7 @@ protected: static constexpr GLint a_extrude = 1; static constexpr GLint a_offset = 2; static constexpr GLint a_data = 3; - static constexpr GLint a_data1 = 4; - static constexpr GLint a_data2 = 5; - static constexpr GLint a_texture_pos = 6; + static constexpr GLint a_texture_pos = 4; private: bool compileShader(gl::UniqueShader&, const GLchar *source); diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index ce33a409f..9df734aee 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -35,7 +35,7 @@ static Observer nullObserver; Style::Style(FileSource& fileSource_, float pixelRatio) : fileSource(fileSource_), glyphStore(std::make_unique(fileSource)), - glyphAtlas(std::make_unique(1024, 1024)), + glyphAtlas(std::make_unique(2048, 2048)), spriteStore(std::make_unique(pixelRatio)), spriteAtlas(std::make_unique(1024, 1024, pixelRatio, *spriteStore)), lineAtlas(std::make_unique(256, 512)), diff --git a/test/fixtures/annotations/fill_annotation/expected.png b/test/fixtures/annotations/fill_annotation/expected.png index 09f48081a..d446537d2 100644 Binary files a/test/fixtures/annotations/fill_annotation/expected.png and b/test/fixtures/annotations/fill_annotation/expected.png differ diff --git a/test/fixtures/annotations/fill_annotation_max_zoom/expected.png b/test/fixtures/annotations/fill_annotation_max_zoom/expected.png index 4e77e671c..69548b535 100644 Binary files a/test/fixtures/annotations/fill_annotation_max_zoom/expected.png and b/test/fixtures/annotations/fill_annotation_max_zoom/expected.png differ diff --git a/test/fixtures/annotations/line_annotation_max_zoom/expected.png b/test/fixtures/annotations/line_annotation_max_zoom/expected.png index 8512d8c06..9e695bacd 100644 Binary files a/test/fixtures/annotations/line_annotation_max_zoom/expected.png and b/test/fixtures/annotations/line_annotation_max_zoom/expected.png differ diff --git a/test/fixtures/annotations/non_immediate_add/expected.png b/test/fixtures/annotations/non_immediate_add/expected.png index 09f48081a..d446537d2 100644 Binary files a/test/fixtures/annotations/non_immediate_add/expected.png and b/test/fixtures/annotations/non_immediate_add/expected.png differ diff --git a/test/fixtures/annotations/overlapping_fill_annotation/expected.png b/test/fixtures/annotations/overlapping_fill_annotation/expected.png index 09f48081a..d446537d2 100644 Binary files a/test/fixtures/annotations/overlapping_fill_annotation/expected.png and b/test/fixtures/annotations/overlapping_fill_annotation/expected.png differ diff --git a/test/fixtures/annotations/style_sourced_shape_annotation/expected.png b/test/fixtures/annotations/style_sourced_shape_annotation/expected.png index 09f48081a..4a6ec2731 100644 Binary files a/test/fixtures/annotations/style_sourced_shape_annotation/expected.png and b/test/fixtures/annotations/style_sourced_shape_annotation/expected.png differ diff --git a/test/fixtures/map/offline/expected.png b/test/fixtures/map/offline/expected.png index c7bfb79fb..973c4102d 100644 Binary files a/test/fixtures/map/offline/expected.png and b/test/fixtures/map/offline/expected.png differ