summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2016-01-12 17:13:11 -0800
committerAnsis Brammanis <brammanis@gmail.com>2016-01-13 16:01:41 -0800
commitf7acc91d2116340b4e0e5386e00b9d5ebfd2dc1c (patch)
tree4cc93d85ff93fcb31deefde4012c56be91cc2f80
parente577354567c467ce5188020ba3e3a4b132a341d6 (diff)
downloadqtlocation-mapboxgl-f7acc91d2116340b4e0e5386e00b9d5ebfd2dc1c.tar.gz
[core] set u_texture uniform value
fix #1685
-rw-r--r--src/mbgl/renderer/painter_symbol.cpp2
-rw-r--r--src/mbgl/shader/icon_shader.hpp1
-rw-r--r--src/mbgl/shader/sdf_shader.hpp1
3 files changed, 4 insertions, 0 deletions
diff --git a/src/mbgl/renderer/painter_symbol.cpp b/src/mbgl/renderer/painter_symbol.cpp
index 9f2d06df22..f0ef2c7996 100644
--- a/src/mbgl/renderer/painter_symbol.cpp
+++ b/src/mbgl/renderer/painter_symbol.cpp
@@ -54,6 +54,7 @@ void Painter::renderSDF(SymbolBucket &bucket,
sdfShader.u_exmatrix = exMatrix;
sdfShader.u_texsize = texsize;
sdfShader.u_skewed = skewed;
+ sdfShader.u_texture = 0;
// adjust min/max zooms for variable font sies
float zoomAdjust = std::log(fontSize / bucketProperties.size) / std::log(2);
@@ -232,6 +233,7 @@ void Painter::renderSymbol(SymbolBucket& bucket, const SymbolLayer& layer, const
iconShader->u_texsize = {{ float(spriteAtlas->getWidth()) / 4.0f, float(spriteAtlas->getHeight()) / 4.0f }};
iconShader->u_skewed = skewed;
iconShader->u_extra = extra;
+ iconShader->u_texture = 0;
// adjust min/max zooms for variable font sies
float zoomAdjust = std::log(fontSize / layout.icon.size) / std::log(2);
diff --git a/src/mbgl/shader/icon_shader.hpp b/src/mbgl/shader/icon_shader.hpp
index df6232cdcc..8a25b635fe 100644
--- a/src/mbgl/shader/icon_shader.hpp
+++ b/src/mbgl/shader/icon_shader.hpp
@@ -23,6 +23,7 @@ public:
Uniform<std::array<GLfloat, 2>> u_texsize = {"u_texsize", *this};
Uniform<GLint> u_skewed = {"u_skewed", *this};
Uniform<GLfloat> u_extra = {"u_extra", *this};
+ Uniform<GLint> u_texture = {"u_texture", *this};
protected:
GLint a_offset = -1;
diff --git a/src/mbgl/shader/sdf_shader.hpp b/src/mbgl/shader/sdf_shader.hpp
index a6f9ce105f..29dbfea047 100644
--- a/src/mbgl/shader/sdf_shader.hpp
+++ b/src/mbgl/shader/sdf_shader.hpp
@@ -22,6 +22,7 @@ public:
Uniform<GLfloat> u_maxfadezoom = {"u_maxfadezoom", *this};
Uniform<GLfloat> u_fadezoom = {"u_fadezoom", *this};
Uniform<GLint> u_skewed = {"u_skewed", *this};
+ Uniform<GLint> u_texture = {"u_texture", *this};
protected:
GLint a_offset = -1;