diff --git a/vtm/resources/assets/shaders/line_aa.glsl b/vtm/resources/assets/shaders/line_aa.glsl
index 8e8619b1..e3531b53 100644
--- a/vtm/resources/assets/shaders/line_aa.glsl
+++ b/vtm/resources/assets/shaders/line_aa.glsl
@@ -8,7 +8,7 @@ uniform mat4 u_mvp;
 uniform float u_width;
 // xy hold position, zw extrusion vector
 attribute vec4 a_pos;
-uniform float u_mode;
+uniform int u_mode;
 uniform float u_height;
 varying vec2 v_st;
 void
@@ -30,13 +30,13 @@ precision highp float;
 #endif
 uniform sampler2D tex;
 uniform float u_fade;
-uniform float u_mode;
+uniform int u_mode;
 uniform vec4 u_color;
 varying vec2 v_st;
 void
 main(){
   float len;
-  if (u_mode == 2.0) {
+  if (u_mode == 2) {
     // round cap line
 #ifdef DESKTOP_QUIRKS
     len = length(v_st);
diff --git a/vtm/resources/assets/shaders/line_aa_proj.glsl b/vtm/resources/assets/shaders/line_aa_proj.glsl
index ce89e056..79b5814f 100644
--- a/vtm/resources/assets/shaders/line_aa_proj.glsl
+++ b/vtm/resources/assets/shaders/line_aa_proj.glsl
@@ -8,7 +8,7 @@ uniform mat4 u_mvp;
 uniform float u_width;
 // xy hold position, zw extrusion vector
 attribute vec4 a_pos;
-uniform float u_mode;
+uniform int u_mode;
 uniform float u_height;
 varying vec2 v_st;
 void
@@ -32,7 +32,7 @@ $$
 precision highp float;
 #endif
 uniform sampler2D tex;
-uniform float u_mode;
+uniform int u_mode;
 uniform vec4 u_color;
 uniform float u_fade;
 varying vec2 v_st;
@@ -40,7 +40,7 @@ void
 main(){
   float len;
   float fuzz;
-  if (u_mode == 2.0) {
+  if (u_mode == 2) {
     /* round cap line */
 #ifdef DESKTOP_QUIRKS
     len = length(v_st);
@@ -55,8 +55,8 @@ main(){
     len = abs(v_st.s);
     fuzz = fwidth(v_st.s);
   }
-  // u_mode == 0.0 -> thin line
-  //  len = len * clamp(u_mode, len, 1.0);
+  // u_mode == 0 -> thin line
+  // len = len * clamp(float(u_mode), len, 1.0);
   if (fuzz > 2.0)
     gl_FragColor = u_color * 0.5;
   else
diff --git a/vtm/resources/assets/shaders/linetex_layer_tex.glsl b/vtm/resources/assets/shaders/linetex_layer_tex.glsl
index 01c5d9b2..2efae361 100644
--- a/vtm/resources/assets/shaders/linetex_layer_tex.glsl
+++ b/vtm/resources/assets/shaders/linetex_layer_tex.glsl
@@ -40,13 +40,13 @@ uniform vec4 u_bgcolor;
 uniform float u_pwidth;
 varying vec2 v_st;
 uniform sampler2D tex;
-uniform float u_mode;
+uniform int u_mode;
 void
 main(){
-  if (u_mode >= 1.0) {
+  if (u_mode >= 1) {
     /* Dash array or texture */
     float step = 2.0;
-    if (u_mode == 2.0) { // dashed texture
+    if (u_mode == 2) { // dashed texture
       step = 1.0;
     }
     // use lineLength mod texture step (mod is always positive)
diff --git a/vtm/src/org/oscim/renderer/bucket/LineBucket.java b/vtm/src/org/oscim/renderer/bucket/LineBucket.java
index ca0a76d4..481cbe55 100644
--- a/vtm/src/org/oscim/renderer/bucket/LineBucket.java
+++ b/vtm/src/org/oscim/renderer/bucket/LineBucket.java
@@ -618,7 +618,7 @@ public class LineBucket extends RenderBucket {
             gl.uniform1f(uLineFade, (float) pixel);
 
             int capMode = 0;
-            gl.uniform1f(uLineMode, capMode);
+            gl.uniform1i(uLineMode, capMode);
 
             boolean blur = false;
             double width;
@@ -682,16 +682,16 @@ public class LineBucket extends RenderBucket {
                     if (lb.scale < 1.5/* || lb.line.fixed*/) {
                         if (capMode != CAP_THIN) {
                             capMode = CAP_THIN;
-                            gl.uniform1f(uLineMode, capMode);
+                            gl.uniform1i(uLineMode, capMode);
                         }
                     } else if (lb.roundCap) {
                         if (capMode != CAP_ROUND) {
                             capMode = CAP_ROUND;
-                            gl.uniform1f(uLineMode, capMode);
+                            gl.uniform1i(uLineMode, capMode);
                         }
                     } else if (capMode != CAP_BUTT) {
                         capMode = CAP_BUTT;
-                        gl.uniform1f(uLineMode, capMode);
+                        gl.uniform1i(uLineMode, capMode);
                     }
 
                     gl.drawArrays(GL.TRIANGLE_STRIP,
@@ -733,11 +733,11 @@ public class LineBucket extends RenderBucket {
                     if (ref.roundCap) {
                         if (capMode != CAP_ROUND) {
                             capMode = CAP_ROUND;
-                            gl.uniform1f(uLineMode, capMode);
+                            gl.uniform1i(uLineMode, capMode);
                         }
                     } else if (capMode != CAP_BUTT) {
                         capMode = CAP_BUTT;
-                        gl.uniform1f(uLineMode, capMode);
+                        gl.uniform1i(uLineMode, capMode);
                     }
 
                     gl.drawArrays(GL.TRIANGLE_STRIP,
diff --git a/vtm/src/org/oscim/renderer/bucket/LineTexBucket.java b/vtm/src/org/oscim/renderer/bucket/LineTexBucket.java
index 436fb0f5..713fe29f 100644
--- a/vtm/src/org/oscim/renderer/bucket/LineTexBucket.java
+++ b/vtm/src/org/oscim/renderer/bucket/LineTexBucket.java
@@ -385,7 +385,7 @@ public final class LineTexBucket extends LineBucket {
                 LineTexBucket lb = (LineTexBucket) b;
                 LineStyle line = lb.line.current();
 
-                gl.uniform1f(shader.uMode, line.dashArray != null ? 2 : (line.texture != null ? 1 : 0));
+                gl.uniform1i(shader.uMode, line.dashArray != null ? 2 : (line.texture != null ? 1 : 0));
 
                 if (line.texture != null)
                     line.texture.bind();