diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-02-14 21:28:19 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-02-14 21:39:39 +0300 |
commit | de0e456a6c7d6da065d275104bc2022b69874648 (patch) | |
tree | c4775fe124ef8af04020bf9863676a429884396b /intern/cycles | |
parent | 9886ae63311da83d962a546bb2c252316ba63538 (diff) |
Cleanup: fix compiler warnings.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/app/cycles_cubin_cc.cpp | 22 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_bake.h | 3 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_volume.h | 6 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_ao.h | 2 |
4 files changed, 21 insertions, 12 deletions
diff --git a/intern/cycles/app/cycles_cubin_cc.cpp b/intern/cycles/app/cycles_cubin_cc.cpp index da8ca53c8df..e6eb0be0d91 100644 --- a/intern/cycles/app/cycles_cubin_cc.cpp +++ b/intern/cycles/app/cycles_cubin_cc.cpp @@ -63,7 +63,7 @@ public: bool fast_math; }; -bool compile_cuda(CompilationSettings &settings) +static bool compile_cuda(CompilationSettings &settings) { const char* headers[] = {"stdlib.h" , "float.h", "math.h", "stdio.h"}; const char* header_content[] = {"\n", "\n", "\n", "\n"}; @@ -99,7 +99,7 @@ bool compile_cuda(CompilationSettings &settings) headers); // includeNames if(result != NVRTC_SUCCESS) { - fprintf(stderr, "Error: nvrtcCreateProgram failed (%x)\n\n", result); + fprintf(stderr, "Error: nvrtcCreateProgram failed (%d)\n\n", (int)result); return false; } @@ -112,7 +112,7 @@ bool compile_cuda(CompilationSettings &settings) result = nvrtcCompileProgram(prog, options.size(), &opts[0]); if(result != NVRTC_SUCCESS) { - fprintf(stderr, "Error: nvrtcCompileProgram failed (%x)\n\n", result); + fprintf(stderr, "Error: nvrtcCompileProgram failed (%d)\n\n", (int)result); size_t log_size; nvrtcGetProgramLogSize(prog, &log_size); @@ -128,14 +128,14 @@ bool compile_cuda(CompilationSettings &settings) size_t ptx_size; result = nvrtcGetPTXSize(prog, &ptx_size); if(result != NVRTC_SUCCESS) { - fprintf(stderr, "Error: nvrtcGetPTXSize failed (%x)\n\n", result); + fprintf(stderr, "Error: nvrtcGetPTXSize failed (%d)\n\n", (int)result); return false; } vector<char> ptx_code(ptx_size); result = nvrtcGetPTX(prog, &ptx_code[0]); if(result != NVRTC_SUCCESS) { - fprintf(stderr, "Error: nvrtcGetPTX failed (%x)\n\n", result); + fprintf(stderr, "Error: nvrtcGetPTX failed (%d)\n\n", (int)result); return false; } @@ -148,7 +148,7 @@ bool compile_cuda(CompilationSettings &settings) return true; } -bool link_ptxas(CompilationSettings &settings) +static bool link_ptxas(CompilationSettings &settings) { string cudapath = ""; if(settings.cuda_toolkit_dir.size()) @@ -166,7 +166,7 @@ bool link_ptxas(CompilationSettings &settings) int pxresult = system(ptx.c_str()); if(pxresult) { - fprintf(stderr, "Error: ptxas failed (%x)\n\n", pxresult); + fprintf(stderr, "Error: ptxas failed (%d)\n\n", pxresult); return false; } @@ -177,17 +177,19 @@ bool link_ptxas(CompilationSettings &settings) return true; } -bool init(CompilationSettings &settings) +static bool init(CompilationSettings &settings) { #ifdef _MSC_VER if(settings.cuda_toolkit_dir.size()) { SetDllDirectory((settings.cuda_toolkit_dir + "/bin").c_str()); } +#else + (void)settings; #endif int cuewresult = cuewInit(CUEW_INIT_NVRTC); if(cuewresult != CUEW_SUCCESS) { - fprintf(stderr, "Error: cuew init fialed (0x%x)\n\n", cuewresult); + fprintf(stderr, "Error: cuew init fialed (0x%d)\n\n", cuewresult); return false; } @@ -229,7 +231,7 @@ bool init(CompilationSettings &settings) return true; } -bool parse_parameters(int argc, const char **argv, CompilationSettings &settings) +static bool parse_parameters(int argc, const char **argv, CompilationSettings &settings) { OIIO::ArgParse ap; ap.options("Usage: cycles_cubin_cc [options]", diff --git a/intern/cycles/kernel/kernel_bake.h b/intern/cycles/kernel/kernel_bake.h index afb63152830..920b10086c5 100644 --- a/intern/cycles/kernel/kernel_bake.h +++ b/intern/cycles/kernel/kernel_bake.h @@ -25,9 +25,7 @@ ccl_device_inline void compute_light_pass(KernelGlobals *kg, int pass_filter, int sample) { - /* initialize master radiance accumulator */ kernel_assert(kernel_data.film.use_light_pass); - path_radiance_init(L, kernel_data.film.use_light_pass); PathRadiance L_sample; PathState state; @@ -299,6 +297,7 @@ ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input, /* light passes */ PathRadiance L; + path_radiance_init(&L, kernel_data.film.use_light_pass); shader_setup_from_sample(kg, &sd, P, Ng, Ng, diff --git a/intern/cycles/kernel/kernel_volume.h b/intern/cycles/kernel/kernel_volume.h index 1df50504434..44c8f795d2c 100644 --- a/intern/cycles/kernel/kernel_volume.h +++ b/intern/cycles/kernel/kernel_volume.h @@ -486,6 +486,9 @@ ccl_device VolumeIntegrateResult kernel_volume_integrate_homogeneous( float3 transmittance = volume_color_transmittance(coeff.sigma_t, t); new_tp = *throughput * transmittance; } + else { + new_tp = *throughput; + } /* integrate emission attenuated by extinction */ if(L && (closure_flag & SD_EMISSION)) { @@ -607,6 +610,9 @@ ccl_device VolumeIntegrateResult kernel_volume_integrate_heterogeneous_distance( transmittance = volume_color_transmittance(coeff.sigma_t, dt); new_tp = tp * transmittance; } + else { + new_tp = tp; + } /* integrate emission attenuated by absorption */ if(L && (closure_flag & SD_EMISSION)) { diff --git a/intern/cycles/kernel/svm/svm_ao.h b/intern/cycles/kernel/svm/svm_ao.h index 15d074780c4..0744ec1768f 100644 --- a/intern/cycles/kernel/svm/svm_ao.h +++ b/intern/cycles/kernel/svm/svm_ao.h @@ -60,6 +60,8 @@ ccl_device_noinline float svm_ao(KernelGlobals *kg, ray.D = D.x*T + D.y*B + D.z*N; ray.t = max_dist; ray.time = sd->time; + ray.dP = sd->dP; + ray.dD = differential3_zero(); if(flags & NODE_AO_ONLY_LOCAL) { if(!scene_intersect_local(kg, |