Cycles: Remove empty closure blur code and the corresponding entries in the switch.

Most compilers will probably optimize that out, but I still don't see a reason to keep it.
This commit is contained in:
Thomas Dinges 2015-02-17 13:43:12 +01:00
parent 4660c00ac5
commit bf878d3c3d
9 changed files with 4 additions and 85 deletions

View 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

View 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;

View 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);

View File

@ -36,14 +36,6 @@
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;

View 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) {

View 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);

View 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);

View 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;

View 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);