forked from bartvdbraak/blender
Fix T75288: crash in Cycles image loading with multithreaded shader compilation
This commit is contained in:
parent
cc53c9e476
commit
c13aa95eda
@ -283,6 +283,7 @@ void ImageManager::set_osl_texture_system(void *texture_system)
|
||||
bool ImageManager::set_animation_frame_update(int frame)
|
||||
{
|
||||
if (frame != animation_frame) {
|
||||
thread_scoped_lock device_lock(images_mutex);
|
||||
animation_frame = frame;
|
||||
|
||||
for (size_t slot = 0; slot < images.size(); slot++) {
|
||||
@ -377,7 +378,7 @@ int ImageManager::add_image_slot(ImageLoader *loader,
|
||||
Image *img;
|
||||
size_t slot;
|
||||
|
||||
thread_scoped_lock device_lock(device_mutex);
|
||||
thread_scoped_lock device_lock(images_mutex);
|
||||
|
||||
/* Fnd existing image. */
|
||||
for (slot = 0; slot < images.size(); slot++) {
|
||||
@ -418,6 +419,7 @@ int ImageManager::add_image_slot(ImageLoader *loader,
|
||||
|
||||
void ImageManager::add_image_user(int slot)
|
||||
{
|
||||
thread_scoped_lock device_lock(images_mutex);
|
||||
Image *image = images[slot];
|
||||
assert(image && image->users >= 1);
|
||||
|
||||
@ -426,6 +428,7 @@ void ImageManager::add_image_user(int slot)
|
||||
|
||||
void ImageManager::remove_image_user(int slot)
|
||||
{
|
||||
thread_scoped_lock device_lock(images_mutex);
|
||||
Image *image = images[slot];
|
||||
assert(image && image->users >= 1);
|
||||
|
||||
|
@ -206,6 +206,7 @@ class ImageManager {
|
||||
bool has_half_images;
|
||||
|
||||
thread_mutex device_mutex;
|
||||
thread_mutex images_mutex;
|
||||
int animation_frame;
|
||||
|
||||
vector<Image *> images;
|
||||
|
Loading…
Reference in New Issue
Block a user