Cleanup: fix compiler warnings.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 14 Feb 2019 18:28:19 +0000 (19:28 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 14 Feb 2019 18:39:39 +0000 (19:39 +0100)
intern/cycles/app/cycles_cubin_cc.cpp
intern/cycles/kernel/kernel_bake.h
intern/cycles/kernel/kernel_volume.h
intern/cycles/kernel/svm/svm_ao.h

index da8ca53..e6eb0be 100644 (file)
@@ -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]",
index afb6315..920b100 100644 (file)
@@ -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,
index 1df5050..44c8f79 100644 (file)
@@ -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)) {
index 15d0747..0744ec1 100644 (file)
@@ -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,