summaryrefslogtreecommitdiff
path: root/src/mbgl/shaders/debug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/shaders/debug.cpp')
-rw-r--r--src/mbgl/shaders/debug.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mbgl/shaders/debug.cpp b/src/mbgl/shaders/debug.cpp
index d39dcf25be..d18f3be5d1 100644
--- a/src/mbgl/shaders/debug.cpp
+++ b/src/mbgl/shaders/debug.cpp
@@ -12,7 +12,12 @@ attribute vec2 a_pos;
uniform mat4 u_matrix;
void main() {
- gl_Position = u_matrix * vec4(a_pos, step(32767.0, a_pos.x), 1);
+ // We are using Int16 for texture position coordinates to give us enough precision for
+ // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer
+ // as an arbitrarily high number to preserve adequate precision when rendering.
+ // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,
+ // so math for modifying either is consistent.
+ gl_Position = u_matrix * vec4(a_pos, step(8192.0, a_pos.x), 1);
}
)MBGL_SHADER";