diff options
Diffstat (limited to 'intern/cycles/kernel/closure')
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_diffuse.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_diffuse_ramp.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_hair.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_microfacet.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_oren_nayar.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_phong_ramp.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_principled_diffuse.h | 3 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_principled_sheen.h | 3 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_toon.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bssrdf.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/volume.h | 3 |
12 files changed, 27 insertions, 0 deletions
diff --git a/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h b/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h index 8122bcc1424..3d3f20edab3 100644 --- a/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h +++ b/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h @@ -42,6 +42,8 @@ typedef ccl_addr_space struct VelvetBsdf { float invsigma2; } VelvetBsdf; +static_assert(sizeof(ShaderClosure) >= sizeof(VelvetBsdf), "VelvetBsdf is too large!"); + ccl_device int bsdf_ashikhmin_velvet_setup(VelvetBsdf *bsdf) { float sigma = fmaxf(bsdf->sigma, 0.01f); diff --git a/intern/cycles/kernel/closure/bsdf_diffuse.h b/intern/cycles/kernel/closure/bsdf_diffuse.h index 76b50548455..ea604ed0311 100644 --- a/intern/cycles/kernel/closure/bsdf_diffuse.h +++ b/intern/cycles/kernel/closure/bsdf_diffuse.h @@ -39,6 +39,8 @@ typedef ccl_addr_space struct DiffuseBsdf { SHADER_CLOSURE_BASE; } DiffuseBsdf; +static_assert(sizeof(ShaderClosure) >= sizeof(DiffuseBsdf), "DiffuseBsdf is too large!"); + /* DIFFUSE */ ccl_device int bsdf_diffuse_setup(DiffuseBsdf *bsdf) diff --git a/intern/cycles/kernel/closure/bsdf_diffuse_ramp.h b/intern/cycles/kernel/closure/bsdf_diffuse_ramp.h index 9d13eb8d4e0..aa62c1c7ceb 100644 --- a/intern/cycles/kernel/closure/bsdf_diffuse_ramp.h +++ b/intern/cycles/kernel/closure/bsdf_diffuse_ramp.h @@ -43,6 +43,8 @@ typedef ccl_addr_space struct DiffuseRampBsdf { float3 *colors; } DiffuseRampBsdf; +static_assert(sizeof(ShaderClosure) >= sizeof(DiffuseRampBsdf), "DiffuseRampBsdf is too large!"); + ccl_device float3 bsdf_diffuse_ramp_get_color(const float3 colors[8], float pos) { int MAXCOLORS = 8; diff --git a/intern/cycles/kernel/closure/bsdf_hair.h b/intern/cycles/kernel/closure/bsdf_hair.h index 4b6f5b3b439..7ca9424b815 100644 --- a/intern/cycles/kernel/closure/bsdf_hair.h +++ b/intern/cycles/kernel/closure/bsdf_hair.h @@ -44,6 +44,8 @@ typedef ccl_addr_space struct HairBsdf { float offset; } HairBsdf; +static_assert(sizeof(ShaderClosure) >= sizeof(HairBsdf), "HairBsdf is too large!"); + ccl_device int bsdf_hair_reflection_setup(HairBsdf *bsdf) { bsdf->type = CLOSURE_BSDF_HAIR_REFLECTION_ID; diff --git a/intern/cycles/kernel/closure/bsdf_microfacet.h b/intern/cycles/kernel/closure/bsdf_microfacet.h index b4da3123f28..7d7ccfa7774 100644 --- a/intern/cycles/kernel/closure/bsdf_microfacet.h +++ b/intern/cycles/kernel/closure/bsdf_microfacet.h @@ -48,6 +48,8 @@ typedef ccl_addr_space struct MicrofacetBsdf { float3 T; } MicrofacetBsdf; +static_assert(sizeof(ShaderClosure) >= sizeof(MicrofacetBsdf), "MicrofacetBsdf is too large!"); + /* Beckmann and GGX microfacet importance sampling. */ ccl_device_inline void microfacet_beckmann_sample_slopes(KernelGlobals *kg, diff --git a/intern/cycles/kernel/closure/bsdf_oren_nayar.h b/intern/cycles/kernel/closure/bsdf_oren_nayar.h index 104ed5b2818..41e5736bf49 100644 --- a/intern/cycles/kernel/closure/bsdf_oren_nayar.h +++ b/intern/cycles/kernel/closure/bsdf_oren_nayar.h @@ -27,6 +27,8 @@ typedef ccl_addr_space struct OrenNayarBsdf { float b; } OrenNayarBsdf; +static_assert(sizeof(ShaderClosure) >= sizeof(OrenNayarBsdf), "OrenNayarBsdf is too large!"); + ccl_device float3 bsdf_oren_nayar_get_intensity(const ShaderClosure *sc, float3 n, float3 v, diff --git a/intern/cycles/kernel/closure/bsdf_phong_ramp.h b/intern/cycles/kernel/closure/bsdf_phong_ramp.h index b6fd0e68681..cf5484383f2 100644 --- a/intern/cycles/kernel/closure/bsdf_phong_ramp.h +++ b/intern/cycles/kernel/closure/bsdf_phong_ramp.h @@ -44,6 +44,8 @@ typedef ccl_addr_space struct PhongRampBsdf { float3 *colors; } PhongRampBsdf; +static_assert(sizeof(ShaderClosure) >= sizeof(PhongRampBsdf), "PhongRampBsdf is too large!"); + ccl_device float3 bsdf_phong_ramp_get_color(const float3 colors[8], float pos) { int MAXCOLORS = 8; diff --git a/intern/cycles/kernel/closure/bsdf_principled_diffuse.h b/intern/cycles/kernel/closure/bsdf_principled_diffuse.h index d7795974ef5..43646aaeb5b 100644 --- a/intern/cycles/kernel/closure/bsdf_principled_diffuse.h +++ b/intern/cycles/kernel/closure/bsdf_principled_diffuse.h @@ -30,6 +30,9 @@ typedef ccl_addr_space struct PrincipledDiffuseBsdf { float roughness; } PrincipledDiffuseBsdf; +static_assert(sizeof(ShaderClosure) >= sizeof(PrincipledDiffuseBsdf), + "PrincipledDiffuseBsdf is too large!"); + ccl_device float3 calculate_principled_diffuse_brdf( const PrincipledDiffuseBsdf *bsdf, float3 N, float3 V, float3 L, float3 H, float *pdf) { diff --git a/intern/cycles/kernel/closure/bsdf_principled_sheen.h b/intern/cycles/kernel/closure/bsdf_principled_sheen.h index bc522095b3b..1326d23668a 100644 --- a/intern/cycles/kernel/closure/bsdf_principled_sheen.h +++ b/intern/cycles/kernel/closure/bsdf_principled_sheen.h @@ -28,6 +28,9 @@ typedef ccl_addr_space struct PrincipledSheenBsdf { SHADER_CLOSURE_BASE; } PrincipledSheenBsdf; +static_assert(sizeof(ShaderClosure) >= sizeof(PrincipledSheenBsdf), + "PrincipledSheenBsdf is too large!"); + ccl_device float3 calculate_principled_sheen_brdf( const PrincipledSheenBsdf *bsdf, float3 N, float3 V, float3 L, float3 H, float *pdf) { diff --git a/intern/cycles/kernel/closure/bsdf_toon.h b/intern/cycles/kernel/closure/bsdf_toon.h index f37fd228087..cc5de21ed0e 100644 --- a/intern/cycles/kernel/closure/bsdf_toon.h +++ b/intern/cycles/kernel/closure/bsdf_toon.h @@ -42,6 +42,8 @@ typedef ccl_addr_space struct ToonBsdf { float smooth; } ToonBsdf; +static_assert(sizeof(ShaderClosure) >= sizeof(ToonBsdf), "ToonBsdf is too large!"); + /* DIFFUSE TOON */ ccl_device int bsdf_diffuse_toon_setup(ToonBsdf *bsdf) diff --git a/intern/cycles/kernel/closure/bssrdf.h b/intern/cycles/kernel/closure/bssrdf.h index a7d9f90b443..125ca4dd830 100644 --- a/intern/cycles/kernel/closure/bssrdf.h +++ b/intern/cycles/kernel/closure/bssrdf.h @@ -30,6 +30,8 @@ typedef ccl_addr_space struct Bssrdf { float channels; } Bssrdf; +static_assert(sizeof(ShaderClosure) >= sizeof(Bssrdf), "Bssrdf is too large!"); + /* Planar Truncated Gaussian * * Note how this is different from the typical gaussian, this one integrates diff --git a/intern/cycles/kernel/closure/volume.h b/intern/cycles/kernel/closure/volume.h index 473bc0e8a82..1430f712701 100644 --- a/intern/cycles/kernel/closure/volume.h +++ b/intern/cycles/kernel/closure/volume.h @@ -40,6 +40,9 @@ typedef ccl_addr_space struct HenyeyGreensteinVolume { float g; } HenyeyGreensteinVolume; +static_assert(sizeof(ShaderClosure) >= sizeof(HenyeyGreensteinVolume), + "HenyeyGreensteinVolume is too large!"); + /* Given cosine between rays, return probability density that a photon bounces * to that direction. The g parameter controls how different it is from the * uniform sphere. g=0 uniform diffuse-like, g=1 close to sharp single ray. */ |