diff options
author | Stefan Werner <stewreo@gmail.com> | 2017-04-27 10:34:51 +0300 |
---|---|---|
committer | Stefan Werner <stewreo@gmail.com> | 2017-04-27 10:35:22 +0300 |
commit | ec25060a05e394560ec92388b347c45bd9eba0ed (patch) | |
tree | 86bef3c575358707945b35fe8c155848bb9465c8 /intern/cycles/render/image.h | |
parent | a6b9bd023b18d8fbf75da6b886312f1ba41302fd (diff) |
Unlimited number of textures for Cycles
This patch allows for an unlimited number of textures in Cycles where the hardware allows. It replaces a number static arrays with dynamic arrays and changes the way the flat_slot indices are calculated. Eventually, I'd like to get to a point where there are only flat slots left and textures off all kinds are stored in a single array.
Note that the arrays in DeviceScene are changed from containing device_vector<T> objects to device_vector<T>* pointers. Ideally, I'd like to store objects, but dynamic resizing of a std:vector in pre-C++11 calls the copy constructor, which for a good reason is not implemented for device_vector. Once we require C++11 for Cycles builds, we can implement a move constructor for device_vector and store objects again.
The limits for CUDA Fermi hardware still apply.
Reviewers: tod_baudais, InsigMathK, dingto, #cycles
Reviewed By: dingto, #cycles
Subscribers: dingto, smellslikedonkey
Differential Revision: https://developer.blender.org/D2650
Diffstat (limited to 'intern/cycles/render/image.h')
-rw-r--r-- | intern/cycles/render/image.h | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h index 996b5a5b65f..76c2cc46f12 100644 --- a/intern/cycles/render/image.h +++ b/intern/cycles/render/image.h @@ -37,17 +37,6 @@ public: explicit ImageManager(const DeviceInfo& info); ~ImageManager(); - enum ImageDataType { - IMAGE_DATA_TYPE_FLOAT4 = 0, - IMAGE_DATA_TYPE_BYTE4 = 1, - IMAGE_DATA_TYPE_HALF4 = 2, - IMAGE_DATA_TYPE_FLOAT = 3, - IMAGE_DATA_TYPE_BYTE = 4, - IMAGE_DATA_TYPE_HALF = 5, - - IMAGE_DATA_NUM_TYPES - }; - int add_image(const string& filename, void *builtin_data, bool animated, @@ -124,7 +113,9 @@ public: private: int tex_num_images[IMAGE_DATA_NUM_TYPES]; - int tex_start_images[IMAGE_DATA_NUM_TYPES]; + int max_num_images; + bool has_half_images; + bool cuda_fermi_limits; thread_mutex device_mutex; int animation_frame; |