summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-07-14 11:54:15 -0700
committerEric Anholt <eric@anholt.net>2015-07-14 15:17:58 -0700
commit9476b11d6edc67403dd7c5aaddbc375400e02425 (patch)
treeef24a05c1cfe82804ad97208c09630c99272cd57
parent320089dbd63de3ac1bd3d42ee8cec41837486d8c (diff)
vc4: Fix some -Wdouble-promotion warnings.
No code generation changes from this, but it'll be useful to have this next time I go checking -Wdouble-promotion.
-rw-r--r--src/gallium/drivers/vc4/vc4_emit.c8
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c2
-rw-r--r--src/gallium/drivers/vc4/vc4_state.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/drivers/vc4/vc4_emit.c b/src/gallium/drivers/vc4/vc4_emit.c
index f592573441..ba064ff889 100644
--- a/src/gallium/drivers/vc4/vc4_emit.c
+++ b/src/gallium/drivers/vc4/vc4_emit.c
@@ -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);
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index df440f627e..f0bfe24c68 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -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),
diff --git a/src/gallium/drivers/vc4/vc4_state.c b/src/gallium/drivers/vc4/vc4_state.c
index 4a1d4c3a4d..e0ce4aee77 100644
--- a/src/gallium/drivers/vc4/vc4_state.c
+++ b/src/gallium/drivers/vc4/vc4_state.c
@@ -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;