diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-04 20:52:18 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-05 03:26:44 +0300 |
commit | 6be8b6af4006e088ac4a2cd8c1adc8f18c04035b (patch) | |
tree | b1fdd6632646e8cc87015294b6a394087ee54583 /source/blender/makesdna/DNA_lightprobe_types.h | |
parent | d1b3da697d814bcb35a718d2d7c660bd2120cb4b (diff) |
EEVEE: LightCache: Prevent crash when using a lightcache too big
Some implementation have different maximum texture size.
This patch avoid crash when texture allocation fails when:
- trying to bake a lightcache too big for the OpenGL imeplementaion.
- loading a cache from file that is too big for the OpenGL imeplementation.
Diffstat (limited to 'source/blender/makesdna/DNA_lightprobe_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_lightprobe_types.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_lightprobe_types.h b/source/blender/makesdna/DNA_lightprobe_types.h index 5ddfedfed2d..c8d091bd074 100644 --- a/source/blender/makesdna/DNA_lightprobe_types.h +++ b/source/blender/makesdna/DNA_lightprobe_types.h @@ -150,7 +150,7 @@ BLI_STATIC_ASSERT_ALIGN(LightGridCache, 16) typedef struct LightCacheTexture { struct GPUTexture *tex; - /* Copy of GPU datas to create GPUTextures on file read. */ + /** Copy of GPU datas to create GPUTextures on file read. */ char *data; int tex_size[3]; char data_type; @@ -204,6 +204,10 @@ enum { LIGHTCACHE_UPDATE_GRID = (1 << 5), LIGHTCACHE_UPDATE_WORLD = (1 << 6), LIGHTCACHE_UPDATE_AUTO = (1 << 7), + /** Invalid means we tried to alloc it but failed. */ + LIGHTCACHE_INVALID = (1 << 8), + /** The data present in the cache is valid but unusable on this GPU. */ + LIGHTCACHE_NOT_USABLE = (1 << 9), }; /* EEVEE_LightCacheTexture->data_type */ |