Cycles: Solve speed regression of classroom scene after principled commit

This way we can skip it from compiling into OpenCL kernels by making
this shader compile-time feature.
This commit is contained in:
Sergey Sharybin
2017-04-21 12:56:54 +02:00
parent b6da2a6a86
commit 9781139590
8 changed files with 38 additions and 3 deletions

View File

@@ -149,6 +149,7 @@ ccl_device void subsurface_scatter_setup_diffuse_bsdf(ShaderData *sd, ShaderClos
if(hit) {
Bssrdf *bssrdf = (Bssrdf *)sc;
#ifdef __PRINCIPLED__
if(bssrdf->type == CLOSURE_BSSRDF_PRINCIPLED_ID) {
PrincipledDiffuseBsdf *bsdf = (PrincipledDiffuseBsdf*)bsdf_alloc(sd, sizeof(PrincipledDiffuseBsdf), weight);
@@ -164,6 +165,7 @@ ccl_device void subsurface_scatter_setup_diffuse_bsdf(ShaderData *sd, ShaderClos
}
else if(CLOSURE_IS_BSDF_BSSRDF(bssrdf->type) ||
CLOSURE_IS_BSSRDF(bssrdf->type))
#endif /* __PRINCIPLED__ */
{
DiffuseBsdf *bsdf = (DiffuseBsdf*)bsdf_alloc(sd, sizeof(DiffuseBsdf), weight);