diff options
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup_line.c | 16 | ||||
-rw-r--r-- | src/gallium/drivers/r600/sb/sb_expr.cpp | 24 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_tex_sample.c | 2 |
3 files changed, 21 insertions, 21 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_line.c b/src/gallium/drivers/llvmpipe/lp_setup_line.c index 3a7212326e3..1357d026dfe 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_line.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_line.c @@ -361,10 +361,10 @@ try_setup_line( struct lp_setup_context *setup, if (fabsf(dx) >= fabsf(dy)) { float dydx = dy / dx; - x1diff = v1[0][0] - (float) floor(v1[0][0]) - 0.5; - y1diff = v1[0][1] - (float) floor(v1[0][1]) - 0.5; - x2diff = v2[0][0] - (float) floor(v2[0][0]) - 0.5; - y2diff = v2[0][1] - (float) floor(v2[0][1]) - 0.5; + x1diff = v1[0][0] - floorf(v1[0][0]) - 0.5f; + y1diff = v1[0][1] - floorf(v1[0][1]) - 0.5f; + x2diff = v2[0][0] - floorf(v2[0][0]) - 0.5f; + y2diff = v2[0][1] - floorf(v2[0][1]) - 0.5f; if (y2diff==-0.5 && dy<0){ y2diff = 0.5; @@ -459,10 +459,10 @@ try_setup_line( struct lp_setup_context *setup, const float dxdy = dx / dy; /* Y-MAJOR LINE */ - x1diff = v1[0][0] - (float) floor(v1[0][0]) - 0.5; - y1diff = v1[0][1] - (float) floor(v1[0][1]) - 0.5; - x2diff = v2[0][0] - (float) floor(v2[0][0]) - 0.5; - y2diff = v2[0][1] - (float) floor(v2[0][1]) - 0.5; + x1diff = v1[0][0] - floorf(v1[0][0]) - 0.5f; + y1diff = v1[0][1] - floorf(v1[0][1]) - 0.5f; + x2diff = v2[0][0] - floorf(v2[0][0]) - 0.5f; + y2diff = v2[0][1] - floorf(v2[0][1]) - 0.5f; if (x2diff==-0.5 && dx<0) { x2diff = 0.5; diff --git a/src/gallium/drivers/r600/sb/sb_expr.cpp b/src/gallium/drivers/r600/sb/sb_expr.cpp index 05674ff24b8..73287f126b0 100644 --- a/src/gallium/drivers/r600/sb/sb_expr.cpp +++ b/src/gallium/drivers/r600/sb/sb_expr.cpp @@ -326,7 +326,7 @@ void expr_handler::apply_alu_src_mod(const bc_alu &bc, unsigned src, const bc_alu_src &s = bc.src[src]; if (s.abs) - v = fabs(v.f); + v = fabsf(v.f); if (s.neg) v = -v.f; } @@ -424,21 +424,21 @@ bool expr_handler::fold_alu_op1(alu_node& n) { apply_alu_src_mod(n.bc, 0, cv); switch (n.bc.op) { - case ALU_OP1_CEIL: dv = ceil(cv.f); break; + case ALU_OP1_CEIL: dv = ceilf(cv.f); break; case ALU_OP1_COS: dv = cos(cv.f * 2.0f * M_PI); break; - case ALU_OP1_EXP_IEEE: dv = exp2(cv.f); break; - case ALU_OP1_FLOOR: dv = floor(cv.f); break; + case ALU_OP1_EXP_IEEE: dv = exp2f(cv.f); break; + case ALU_OP1_FLOOR: dv = floorf(cv.f); break; case ALU_OP1_FLT_TO_INT: dv = (int)cv.f; break; // FIXME: round modes ???? - case ALU_OP1_FLT_TO_INT_FLOOR: dv = (int32_t)floor(cv.f); break; - case ALU_OP1_FLT_TO_INT_RPI: dv = (int32_t)floor(cv.f + 0.5f); break; - case ALU_OP1_FLT_TO_INT_TRUNC: dv = (int32_t)trunc(cv.f); break; + case ALU_OP1_FLT_TO_INT_FLOOR: dv = (int32_t)floorf(cv.f); break; + case ALU_OP1_FLT_TO_INT_RPI: dv = (int32_t)floorf(cv.f + 0.5f); break; + case ALU_OP1_FLT_TO_INT_TRUNC: dv = (int32_t)truncf(cv.f); break; case ALU_OP1_FLT_TO_UINT: dv = (uint32_t)cv.f; break; - case ALU_OP1_FRACT: dv = cv.f - floor(cv.f); break; + case ALU_OP1_FRACT: dv = cv.f - floorf(cv.f); break; case ALU_OP1_INT_TO_FLT: dv = (float)cv.i; break; case ALU_OP1_LOG_CLAMPED: case ALU_OP1_LOG_IEEE: if (cv.f != 0.0f) - dv = log2(cv.f); + dv = log2f(cv.f); else // don't fold to NAN, let the GPU handle it for now // (prevents degenerate LIT tests from failing) @@ -454,7 +454,7 @@ bool expr_handler::fold_alu_op1(alu_node& n) { case ALU_OP1_PRED_SET_RESTORE: dv = cv; break; case ALU_OP1_RECIPSQRT_CLAMPED: case ALU_OP1_RECIPSQRT_FF: - case ALU_OP1_RECIPSQRT_IEEE: dv = 1.0f / sqrt(cv.f); break; + case ALU_OP1_RECIPSQRT_IEEE: dv = 1.0f / sqrtf(cv.f); break; case ALU_OP1_RECIP_CLAMPED: case ALU_OP1_RECIP_FF: case ALU_OP1_RECIP_IEEE: dv = 1.0f / cv.f; break; @@ -462,8 +462,8 @@ bool expr_handler::fold_alu_op1(alu_node& n) { case ALU_OP1_RECIP_UINT: dv.u = (1ull << 32) / cv.u; break; // case ALU_OP1_RNDNE: dv = floor(cv.f + 0.5f); break; case ALU_OP1_SIN: dv = sin(cv.f * 2.0f * M_PI); break; - case ALU_OP1_SQRT_IEEE: dv = sqrt(cv.f); break; - case ALU_OP1_TRUNC: dv = trunc(cv.f); break; + case ALU_OP1_SQRT_IEEE: dv = sqrtf(cv.f); break; + case ALU_OP1_TRUNC: dv = truncf(cv.f); break; default: return false; diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c index d3f67c6426c..5a0ec40d9c8 100644 --- a/src/gallium/drivers/softpipe/sp_tex_sample.c +++ b/src/gallium/drivers/softpipe/sp_tex_sample.c @@ -2320,7 +2320,7 @@ create_filter_table(void) for (i = 0; i < WEIGHT_LUT_SIZE; ++i) { const float alpha = 2; const float r2 = (float) i / (float) (WEIGHT_LUT_SIZE - 1); - const float weight = (float) exp(-alpha * r2); + const float weight = (float) expf(-alpha * r2); lut[i] = weight; } weightLut = lut; |