From cd897c57f818a1159b7510e46f436183bffce9e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Thu, 28 Feb 2019 15:10:14 +0100 Subject: Fix T62040: Irradiance Volume broken Was broken by 6a03199b50e02d57a50eb24441ef7be0b7e965ac. Reintroducing the padding along with a few comment to not reproduce the same errors. --- source/blender/makesdna/DNA_lightprobe_types.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/makesdna/DNA_lightprobe_types.h b/source/blender/makesdna/DNA_lightprobe_types.h index d9fd22c51c8..f852b1f5a7f 100644 --- a/source/blender/makesdna/DNA_lightprobe_types.h +++ b/source/blender/makesdna/DNA_lightprobe_types.h @@ -115,14 +115,20 @@ enum { /* Needs to be there because written to file * with the lightcache. */ +/* IMPORTANT Padding in these structs is essential. It must match + * GLSL struct definition in lightprobe_lib.glsl. */ + +/* Must match CubeData. */ typedef struct LightProbeCache { float position[3], parallax_type; float attenuation_fac; float attenuation_type; + float _pad3[2]; float attenuationmat[4][4]; float parallaxmat[4][4]; } LightProbeCache; +/* Must match GridData. */ typedef struct LightGridCache { float mat[4][4]; /** Offset to the first irradiance sample in the pool. */ @@ -131,8 +137,8 @@ typedef struct LightGridCache { /** World space vector between 2 opposite cells. */ float increment_x[3], attenuation_bias; float increment_y[3], level_bias; - float increment_z[3]; - float visibility_bias, visibility_bleed, visibility_range; + float increment_z[3], _pad4; + float visibility_bias, visibility_bleed, visibility_range, _pad5; } LightGridCache; /* ------ Eevee Lightcache ------- */ -- cgit v1.2.3