diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-10-08 02:09:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-10-08 02:13:26 +0400 |
commit | be3a6d78e8689fb700b1cafd71b565831cb5762f (patch) | |
tree | 65b354bc401b353c2905d5794bd981ba2bbfd3b2 | |
parent | e2522b4a291b5b67f040fadbbef6f52ccce838ed (diff) |
Cycles: reduce float/double conversions
-rw-r--r-- | intern/cycles/blender/blender_session.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/render/shader.cpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index 0610c3f6579..57ffea4b1a9 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -830,7 +830,7 @@ void BlenderSession::update_status_progress() if(background) { if(progress>0) - remaining_time = (1-progress) * (total_time / progress); + remaining_time = (1.0 - (double)progress) * (total_time / (double)progress); scene += " | " + b_scene.name(); if(b_rlay_name != "") @@ -849,7 +849,7 @@ void BlenderSession::update_status_progress() timestatus += "Remaining:" + string(time_str) + " | "; } - timestatus += string_printf("Mem:%.2fM, Peak:%.2fM", mem_used, mem_peak); + timestatus += string_printf("Mem:%.2fM, Peak:%.2fM", (double)mem_used, (double)mem_peak); if(status.size() > 0) status = " | " + status; diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp index d76e511859a..d8925852c21 100644 --- a/intern/cycles/render/shader.cpp +++ b/intern/cycles/render/shader.cpp @@ -83,7 +83,7 @@ static void beckmann_table_rows(float *table, int row_from, int row_to) } /* CDF of P22_{omega_i}(x_slope, 1, 1), Eq. (10) */ - CDF_P22_omega_i[index_slope_x] = CDF_P22_omega_i[index_slope_x - 1] + P22_omega_i; + CDF_P22_omega_i[index_slope_x] = CDF_P22_omega_i[index_slope_x - 1] + (double)P22_omega_i; } /* renormalize CDF_P22_omega_i */ @@ -106,8 +106,8 @@ static void beckmann_table_rows(float *table, int row_from, int row_to) /* store value */ table[index_U + index_theta*BECKMANN_TABLE_SIZE] = (float)( - interp * slope_x[index_slope_x - 1] - + (1.0f-interp) * slope_x[index_slope_x]); + interp * slope_x[index_slope_x - 1] + + (1.0 - interp) * slope_x[index_slope_x]); } } } |