diff options
author | Sergey Sharybin <sergey@blender.org> | 2021-10-29 13:23:36 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2021-11-01 14:47:03 +0300 |
commit | 9111ea78acf457c27655dbdd7e7fd9d221db67e0 (patch) | |
tree | ab35e9a472c98f841fdadaf23b8cc4ec8af45429 /source/blender/makesdna/DNA_image_types.h | |
parent | b6dd5be2136897bf421027644e519d2ac494022c (diff) |
Localize image mutex lock into runtime field of Image datablock
Allows to avoid a global lock being held while reading files from disk,
solving performance issues when Cycles needs to read a lot of packed
images.
Simple test file F11597666
Differential Revision: https://developer.blender.org/D13032
Diffstat (limited to 'source/blender/makesdna/DNA_image_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_image_types.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h index 30ca9540735..319e1aa75f6 100644 --- a/source/blender/makesdna/DNA_image_types.h +++ b/source/blender/makesdna/DNA_image_types.h @@ -147,6 +147,12 @@ typedef enum eImageTextureResolution { IMA_TEXTURE_RESOLUTION_LEN } eImageTextureResolution; +typedef struct Image_Runtime { + /* Mutex used to guarantee thread-safe access to the cached ImBuf of the corresponding image ID. + */ + void *cache_mutex; +} Image_Runtime; + typedef struct Image { ID id; @@ -213,6 +219,8 @@ typedef struct Image { /** ImageView. */ ListBase views; struct Stereo3dFormat *stereo3d_format; + + Image_Runtime runtime; } Image; /* **************** IMAGE ********************* */ |