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
This commit is contained in:
Sergey Sharybin 2015-10-11 18:15:02 +05:00
parent 9b247bdf61
commit 8a1afc28db
2 changed files with 10 additions and 0 deletions

View File

@ -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)

View File

@ -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