Fix cycles CUDA error when trying to use >= 100 image textures.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 9 Jun 2014 10:38:46 +0000 (12:38 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 9 Jun 2014 10:40:13 +0000 (12:40 +0200)
intern/cycles/render/image.cpp

index 77cd6d5e79dbd9d301523cb89fd4c25b88d6b146..f45131051da7fc99592bbd66aee09cef754ef7b2 100644 (file)
@@ -576,7 +576,8 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
 
                string name;
 
-               if(slot >= 10) name = string_printf("__tex_image_float_0%d", slot);
+               if(slot >= 100) name = string_printf("__tex_image_float_%d", slot);
+               else if(slot >= 10) name = string_printf("__tex_image_float_0%d", slot);
                else name = string_printf("__tex_image_float_00%d", slot);
 
                if(!pack_images) {
@@ -607,7 +608,8 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
 
                string name;
 
-               if(slot >= 10) name = string_printf("__tex_image_0%d", slot);
+               if(slot >= 100) name = string_printf("__tex_image_%d", slot);
+               else if(slot >= 10) name = string_printf("__tex_image_0%d", slot);
                else name = string_printf("__tex_image_00%d", slot);
 
                if(!pack_images) {