diff options
author | Lukas Stockner <lukasstockner97> | 2019-12-16 17:49:19 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2019-12-16 18:09:01 +0300 |
commit | 6a3f2b30d206df23120cd212132adea821b6c20e (patch) | |
tree | 310ed682316f18d3625dfee61c1a1bf1acbda10a /source/blender/blenlib/intern/BLI_ghash_utils.c | |
parent | 8d16dc029e6c52b16666b4edfafa66794d64b1a4 (diff) |
Fix T72467: Crash when using many (>64) images in a shader
Previously this limit was rather high, but with UDIMs it's fairly easy
to reach this many images. Even though this exceeds the texture limit
on most hardware as far as I can tell, it should at least not crash.
The old code uses a fixed array which overflows eventually, this fix
replaces the array with a GSet.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D6416
Diffstat (limited to 'source/blender/blenlib/intern/BLI_ghash_utils.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash_utils.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/BLI_ghash_utils.c b/source/blender/blenlib/intern/BLI_ghash_utils.c index 1c6484acbdf..63559da5bd7 100644 --- a/source/blender/blenlib/intern/BLI_ghash_utils.c +++ b/source/blender/blenlib/intern/BLI_ghash_utils.c @@ -278,4 +278,13 @@ GSet *BLI_gset_pair_new(const char *info) return BLI_gset_pair_new_ex(info, 0); } +GSet *BLI_gset_int_new_ex(const char *info, const uint nentries_reserve) +{ + return BLI_gset_new_ex(BLI_ghashutil_inthash_p, BLI_ghashutil_intcmp, info, nentries_reserve); +} +GSet *BLI_gset_int_new(const char *info) +{ + return BLI_gset_int_new_ex(info, 0); +} + /** \} */ |