vc4: Fix some -Wdouble-promotion warnings.
authorEric Anholt <eric@anholt.net>
Tue, 14 Jul 2015 18:54:15 +0000 (11:54 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 14 Jul 2015 22:17:58 +0000 (15:17 -0700)
No code generation changes from this, but it'll be useful to have this
next time I go checking -Wdouble-promotion.

src/gallium/drivers/vc4/vc4_emit.c
src/gallium/drivers/vc4/vc4_program.c
src/gallium/drivers/vc4/vc4_state.c

index f5925734415bf053e5bc066814f87a542c179666..ba064ff889bdb5785570765fd5a014a1e989bd9b 100644 (file)
@@ -32,10 +32,10 @@ vc4_emit_state(struct pipe_context *pctx)
         if (vc4->dirty & (VC4_DIRTY_SCISSOR | VC4_DIRTY_VIEWPORT)) {
                 float *vpscale = vc4->viewport.scale;
                 float *vptranslate = vc4->viewport.translate;
-                float vp_minx = -fabs(vpscale[0]) + vptranslate[0];
-                float vp_maxx = fabs(vpscale[0]) + vptranslate[0];
-                float vp_miny = -fabs(vpscale[1]) + vptranslate[1];
-                float vp_maxy = fabs(vpscale[1]) + vptranslate[1];
+                float vp_minx = -fabsf(vpscale[0]) + vptranslate[0];
+                float vp_maxx = fabsf(vpscale[0]) + vptranslate[0];
+                float vp_miny = -fabsf(vpscale[1]) + vptranslate[1];
+                float vp_maxy = fabsf(vpscale[1]) + vptranslate[1];
                 uint32_t minx = MAX2(vc4->scissor.minx, vp_minx);
                 uint32_t miny = MAX2(vc4->scissor.miny, vp_miny);
                 uint32_t maxx = MIN2(vc4->scissor.maxx, vp_maxx);
index df440f627ec84ce190922952f0a2c6df74587669..f0bfe24c68ac5444acb433099be00b9f1082b24a 100644 (file)
@@ -558,7 +558,7 @@ ntq_fsin(struct vc4_compile *c, struct qreg src)
         struct qreg scaled_x =
                 qir_FMUL(c,
                          src,
-                         qir_uniform_f(c, 1.0f / (M_PI * 2.0f)));
+                         qir_uniform_f(c, 1.0 / (M_PI * 2.0)));
 
         struct qreg x = qir_FADD(c,
                                  ntq_ffract(c, scaled_x),
index 4a1d4c3a4d64981d85e983c0f21becc45e141e0c..e0ce4aee7799f3044e1e608709068ea8bb0bc19b 100644 (file)
@@ -107,7 +107,7 @@ vc4_create_rasterizer_state(struct pipe_context *pctx,
         /* Workaround: HW-2726 PTB does not handle zero-size points (BCM2835,
          * BCM21553).
          */
-        so->point_size = MAX2(cso->point_size, .125);
+        so->point_size = MAX2(cso->point_size, .125f);
 
         if (cso->front_ccw)
                 so->config_bits[0] |= VC4_CONFIG_BITS_CW_PRIMITIVES;