Fix compiler warning due to undefined BVH_FUNCTION_FEATURES with patch by Campbell,
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 20 Aug 2013 18:25:59 +0000 (18:25 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 20 Aug 2013 18:25:59 +0000 (18:25 +0000)
and a coverity warning about use of uninitialized variables with OSL.

intern/cycles/kernel/kernel_bvh.h
intern/cycles/kernel/osl/osl_shader.cpp

index 4cc92254b016ec3fdf6b6c132c495ae985ff7b4c..4d37b6ddcf4f837d08fee0a19d0552a71f6378db 100644 (file)
@@ -782,6 +782,7 @@ __device_inline void bvh_triangle_intersect_subsurface(KernelGlobals *kg, Inters
 
 #if defined(__SUBSURFACE__)
 #define BVH_FUNCTION_NAME bvh_intersect_subsurface
+#define BVH_FUNCTION_FEATURES 0
 #include "kernel_bvh_subsurface.h"
 #endif
 
index 6599ee31d80e8095bbc3b44079afdce11148a828..c55f36bcc9d08eda71ff182849579de1b53aa302 100644 (file)
@@ -189,6 +189,8 @@ static void flatten_surface_closure_tree(ShaderData *sd, int path_flag,
 
                                        sc.sample_weight = sample_weight;
                                        sc.type = CLOSURE_EMISSION_ID;
+                                       sc.data0 = 0.0f;
+                                       sc.data1 = 0.0f;
                                        sc.prim = NULL;
 
                                        /* flag */
@@ -204,6 +206,8 @@ static void flatten_surface_closure_tree(ShaderData *sd, int path_flag,
 
                                        sc.sample_weight = sample_weight;
                                        sc.type = CLOSURE_AMBIENT_OCCLUSION_ID;
+                                       sc.data0 = 0.0f;
+                                       sc.data1 = 0.0f;
                                        sc.prim = NULL;
 
                                        if(sd->num_closure < MAX_CLOSURE) {
@@ -215,6 +219,8 @@ static void flatten_surface_closure_tree(ShaderData *sd, int path_flag,
                                case OSL::ClosurePrimitive::Holdout: {
                                        sc.sample_weight = 0.0f;
                                        sc.type = CLOSURE_HOLDOUT_ID;
+                                       sc.data0 = 0.0f;
+                                       sc.data1 = 0.0f;
                                        sc.prim = NULL;
 
                                        if(sd->num_closure < MAX_CLOSURE) {