diff options
author | Thomas Dinges <blender@dingto.org> | 2016-04-16 21:48:33 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2016-04-16 21:49:59 +0300 |
commit | 557544f2c452303ff4b4d3af96551841e4d79040 (patch) | |
tree | 06e0409ce904eecda37a6784977d652087c34afc /intern/cycles/util | |
parent | b973911feeec1bf487b35245005406fb32018cbf (diff) |
Cycles: Refactor Image Texture limits.
Instead of treating Fermi GPU limits as default,
and overriding them for other devices,
we now nicely set them for each platform.
* Due to setting values for all platforms,
we don't have to offset the slot id for OpenCL anymore,
as the image manager wont add float images for OpenCL now.
* Bugfix: TEX_NUM_FLOAT_IMAGES was always 5, even for CPU,
so the code in svm_image.h clamped float textures with alpha on CPU after the 5th slot.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht
Differential Revision: https://developer.blender.org/D1925
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_texture.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/intern/cycles/util/util_texture.h b/intern/cycles/util/util_texture.h index 0ae267571d2..2b6b8e743fb 100644 --- a/intern/cycles/util/util_texture.h +++ b/intern/cycles/util/util_texture.h @@ -21,26 +21,26 @@ CCL_NAMESPACE_BEGIN /* Texture limits on various devices. */ -#define TEX_NUM_FLOAT_IMAGES 5 +/* CPU */ +#define TEX_NUM_BYTE_IMAGES_CPU 1024 +#define TEX_NUM_FLOAT_IMAGES_CPU 1024 +#define TEX_IMAGE_BYTE_START_CPU TEX_NUM_FLOAT_IMAGES_CPU + +/* CUDA (Fermi) */ +#define TEX_NUM_BYTE_IMAGES_CUDA 88 +#define TEX_NUM_FLOAT_IMAGES_CUDA 5 +#define TEX_IMAGE_BYTE_START_CUDA TEX_NUM_FLOAT_IMAGES_CUDA + +/* CUDA (KEPLER and above) */ +#define TEX_NUM_BYTE_IMAGES_CUDA_KEPLER 145 +#define TEX_NUM_FLOAT_IMAGES_CUDA_KEPLER 5 +#define TEX_IMAGE_BYTE_START_CUDA_KELPER TEX_NUM_FLOAT_IMAGES_CUDA_KEPLER + +/* OpenCL */ +#define TEX_NUM_BYTE_IMAGES_OPENCL 1024 +#define TEX_NUM_FLOAT_IMAGES_OPENCL 0 +#define TEX_IMAGE_BYTE_START_OPENCL TEX_NUM_FLOAT_IMAGES_OPENCL -/* generic */ -#define TEX_NUM_IMAGES 88 -#define TEX_IMAGE_BYTE_START TEX_NUM_FLOAT_IMAGES - -/* extended gpu */ -#define TEX_EXTENDED_NUM_IMAGES_GPU 145 - -/* extended cpu */ -#define TEX_EXTENDED_NUM_FLOAT_IMAGES 1024 -#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 |