[Bf-blender-cvs] [a5938e0] blender-v2.76-release: Cycles: Increase number of textures allowed for OpenCL render
Sergey Sharybin
noreply at git.blender.org
Thu Oct 29 12:06:39 CET 2015
Commit: a5938e01e545c64127fc958edb083d483e1dee09
Author: Sergey Sharybin
Date: Sun Oct 11 18:15:02 2015 +0500
Branches: blender-v2.76-release
https://developer.blender.org/rBa5938e01e545c64127fc958edb083d483e1dee09
Cycles: Increase number of textures allowed for OpenCL render
Currently OpenCL devices are packing images into a single texture,
which means technically number of textures is not limited here.
Now OpenCL will use same number of textures as CPU. If we want
to bump number of textures further, this values are to be modified
in sync.
NOTE OpenCL still does not support float textures.
Original patch from a guy called bliblubli in the tracker with
some own modifications.
Reviewers: brecht, dingto, sergey
Differential Revision: https://developer.blender.org/D1530
===================================================================
M intern/cycles/render/image.cpp
M intern/cycles/render/image.h
===================================================================
diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp
index 7bceb8a..7a846e1 100644
--- a/intern/cycles/render/image.cpp
+++ b/intern/cycles/render/image.cpp
@@ -69,6 +69,9 @@ void ImageManager::set_extended_image_limits(const DeviceInfo& info)
else if((info.type == DEVICE_CUDA || info.type == DEVICE_MULTI) && info.extended_images) {
tex_num_images = TEX_EXTENDED_NUM_IMAGES_GPU;
}
+ else if(info.pack_images) {
+ tex_num_images = TEX_PACKED_NUM_IMAGES;
+ }
}
bool ImageManager::set_animation_frame_update(int frame)
diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h
index bcc58ae..c79c152 100644
--- a/intern/cycles/render/image.h
+++ b/intern/cycles/render/image.h
@@ -40,6 +40,13 @@ CCL_NAMESPACE_BEGIN
#define TEX_EXTENDED_NUM_IMAGES_CPU 1024
#define TEX_EXTENDED_IMAGE_BYTE_START TEX_EXTENDED_NUM_FLOAT_IMAGES
+/* Limitations for packed images.
+ *
+ * Technically number of textures is unlimited, but it should in
+ * fact be in sync with CPU limitations.
+ */
+#define TEX_PACKED_NUM_IMAGES 1024
+
/* color to use when textures are not found */
#define TEX_IMAGE_MISSING_R 1
#define TEX_IMAGE_MISSING_G 0
More information about the Bf-blender-cvs
mailing list