Cycles: Remove empty closure blur code and the corresponding entries in the switch.
authorThomas Dinges <blender@dingto.org>
Tue, 17 Feb 2015 12:43:12 +0000 (13:43 +0100)
committerThomas Dinges <blender@dingto.org>
Tue, 17 Feb 2015 12:44:25 +0000 (13:44 +0100)
Most compilers will probably optimize that out, but I still don't see a reason to keep it.

intern/cycles/kernel/closure/bsdf.h
intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h
intern/cycles/kernel/closure/bsdf_diffuse.h
intern/cycles/kernel/closure/bsdf_hair.h
intern/cycles/kernel/closure/bsdf_oren_nayar.h
intern/cycles/kernel/closure/bsdf_reflection.h
intern/cycles/kernel/closure/bsdf_refraction.h
intern/cycles/kernel/closure/bsdf_toon.h
intern/cycles/kernel/closure/bsdf_transparent.h

index 56cd52f69e6d33fd3d2faacada6f01922681fcc6..2b9e2a4e44d7a80288a67cbf886f0a355e806fe7 100644 (file)
@@ -275,6 +275,8 @@ ccl_device float3 bsdf_eval(KernelGlobals *kg, const ShaderData *sd, const Shade
 
 ccl_device void bsdf_blur(KernelGlobals *kg, ShaderClosure *sc, float roughness)
 {
+/* ToDo: do we want to blur volume closures? */
+
 #ifdef __OSL__
        if(kg->osl && sc->prim) {
                OSLShader::bsdf_blur(sc, roughness);
@@ -282,33 +284,8 @@ ccl_device void bsdf_blur(KernelGlobals *kg, ShaderClosure *sc, float roughness)
        }
 #endif
 
-       switch(sc->type) {
-               case CLOSURE_BSDF_DIFFUSE_ID:
-               case CLOSURE_BSDF_BSSRDF_ID:
-                       bsdf_diffuse_blur(sc, roughness);
-                       break;
 #ifdef __SVM__
-               case CLOSURE_BSDF_OREN_NAYAR_ID:
-                       bsdf_oren_nayar_blur(sc, roughness);
-                       break;
-               /*case CLOSURE_BSDF_PHONG_RAMP_ID:
-                       bsdf_phong_ramp_blur(sc, roughness);
-                       break;
-               case CLOSURE_BSDF_DIFFUSE_RAMP_ID:
-                       bsdf_diffuse_ramp_blur(sc, roughness);
-                       break;*/
-               case CLOSURE_BSDF_TRANSLUCENT_ID:
-                       bsdf_translucent_blur(sc, roughness);
-                       break;
-               case CLOSURE_BSDF_REFLECTION_ID:
-                       bsdf_reflection_blur(sc, roughness);
-                       break;
-               case CLOSURE_BSDF_REFRACTION_ID:
-                       bsdf_refraction_blur(sc, roughness);
-                       break;
-               case CLOSURE_BSDF_TRANSPARENT_ID:
-                       bsdf_transparent_blur(sc, roughness);
-                       break;
+       switch(sc->type) {
                case CLOSURE_BSDF_MICROFACET_GGX_ID:
                case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID:
                case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
@@ -323,24 +300,10 @@ ccl_device void bsdf_blur(KernelGlobals *kg, ShaderClosure *sc, float roughness)
                case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID:
                        bsdf_ashikhmin_shirley_blur(sc, roughness);
                        break;
-               case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID:
-                       bsdf_ashikhmin_velvet_blur(sc, roughness);
-                       break;
-               case CLOSURE_BSDF_DIFFUSE_TOON_ID:
-                       bsdf_diffuse_toon_blur(sc, roughness);
-                       break;
-               case CLOSURE_BSDF_GLOSSY_TOON_ID:
-                       bsdf_glossy_toon_blur(sc, roughness);
-                       break;
-               case CLOSURE_BSDF_HAIR_REFLECTION_ID:
-               case CLOSURE_BSDF_HAIR_TRANSMISSION_ID:
-                       bsdf_hair_reflection_blur(sc, roughness);
-                       break;
-#endif
-               /* todo: do we want to blur volume closures? */
                default:
                        break;
        }
+#endif
 }
 
 CCL_NAMESPACE_END
index 3631f90bf8c8133b08e3015e45ddf5ee2ff3b685..580f50d5dd6b7893032a9659ddc0f8e01c63d03f 100644 (file)
@@ -45,10 +45,6 @@ ccl_device int bsdf_ashikhmin_velvet_setup(ShaderClosure *sc)
        return SD_BSDF|SD_BSDF_HAS_EVAL;
 }
 
-ccl_device void bsdf_ashikhmin_velvet_blur(ShaderClosure *sc, float roughness)
-{
-}
-
 ccl_device float3 bsdf_ashikhmin_velvet_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
 {
        float m_invsigma2 = sc->data0;
index 371f467000c081b55e02c25456208f49505482d7..4b29bb096d180c13af894e331b3257385fe931fe 100644 (file)
@@ -43,10 +43,6 @@ ccl_device int bsdf_diffuse_setup(ShaderClosure *sc)
        return SD_BSDF|SD_BSDF_HAS_EVAL;
 }
 
-ccl_device void bsdf_diffuse_blur(ShaderClosure *sc, float roughness)
-{
-}
-
 ccl_device float3 bsdf_diffuse_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
 {
        float3 N = sc->N;
@@ -90,10 +86,6 @@ ccl_device int bsdf_translucent_setup(ShaderClosure *sc)
        return SD_BSDF|SD_BSDF_HAS_EVAL;
 }
 
-ccl_device void bsdf_translucent_blur(ShaderClosure *sc, float roughness)
-{
-}
-
 ccl_device float3 bsdf_translucent_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
 {
        return make_float3(0.0f, 0.0f, 0.0f);
index 8ef95435e7282bb006bcaffde13cc70490ea801f..f26ede0381d9e3e9ea0d8690e380e0e02272290b 100644 (file)
 CCL_NAMESPACE_BEGIN
 
 
-ccl_device void bsdf_hair_reflection_blur(ShaderClosure *sc, float roughness)
-{
-}
-
-ccl_device void bsdf_hair_transmission_blur(ShaderClosure *sc, float roughness)
-{
-}
-
 ccl_device int bsdf_hair_reflection_setup(ShaderClosure *sc)
 {
        sc->type = CLOSURE_BSDF_HAIR_REFLECTION_ID;
index d18c3dd61426a0577554a43c36e9f43857955581..c476d4ca4e27e277844f55c03a2f471280b18cde 100644 (file)
@@ -47,10 +47,6 @@ ccl_device int bsdf_oren_nayar_setup(ShaderClosure *sc)
        return SD_BSDF|SD_BSDF_HAS_EVAL;
 }
 
-ccl_device void bsdf_oren_nayar_blur(ShaderClosure *sc, float roughness)
-{
-}
-
 ccl_device float3 bsdf_oren_nayar_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
 {
        if(dot(sc->N, omega_in) > 0.0f) {
index 6b90236525d411cf887429d2d2e774aba1be2bd7..303f4c9ce343899c4ecaa7a8a968b9029d049dd7 100644 (file)
@@ -43,10 +43,6 @@ ccl_device int bsdf_reflection_setup(ShaderClosure *sc)
        return SD_BSDF;
 }
 
-ccl_device void bsdf_reflection_blur(ShaderClosure *sc, float roughness)
-{
-}
-
 ccl_device float3 bsdf_reflection_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
 {
        return make_float3(0.0f, 0.0f, 0.0f);
index 02a06941afa2bbeafd0ce54307b89840be16daf1..c78a4b67134deaf83f3d5d466853d897cfc6d8ec 100644 (file)
@@ -43,10 +43,6 @@ ccl_device int bsdf_refraction_setup(ShaderClosure *sc)
        return SD_BSDF;
 }
 
-ccl_device void bsdf_refraction_blur(ShaderClosure *sc, float roughness)
-{
-}
-
 ccl_device float3 bsdf_refraction_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
 {
        return make_float3(0.0f, 0.0f, 0.0f);
index 797fa4227aebcc2a4009d5ab78e6948c21056e4c..df03942638f885d70fd8fb8593e6c6762d3548ef 100644 (file)
@@ -46,10 +46,6 @@ ccl_device int bsdf_diffuse_toon_setup(ShaderClosure *sc)
        return SD_BSDF|SD_BSDF_HAS_EVAL;
 }
 
-ccl_device void bsdf_diffuse_toon_blur(ShaderClosure *sc, float roughness)
-{
-}
-
 ccl_device float3 bsdf_toon_get_intensity(float max_angle, float smooth, float angle)
 {
        float is;
@@ -130,10 +126,6 @@ ccl_device int bsdf_glossy_toon_setup(ShaderClosure *sc)
        return SD_BSDF|SD_BSDF_HAS_EVAL;
 }
 
-ccl_device void bsdf_glossy_toon_blur(ShaderClosure *sc, float roughness)
-{
-}
-
 ccl_device float3 bsdf_glossy_toon_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
 {
        float max_angle = sc->data0*M_PI_2_F;
index 73601d20c3a45b57cb705cd470199f8d9d2c1954..3c2fd8004dfb539b3acc90861a0da08094e519a8 100644 (file)
@@ -41,10 +41,6 @@ ccl_device int bsdf_transparent_setup(ShaderClosure *sc)
        return SD_BSDF|SD_TRANSPARENT;
 }
 
-ccl_device void bsdf_transparent_blur(ShaderClosure *sc, float roughness)
-{
-}
-
 ccl_device float3 bsdf_transparent_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
 {
        return make_float3(0.0f, 0.0f, 0.0f);