diff options
author | Mai Lavelle <mai.lavelle@gmail.com> | 2017-03-11 13:23:11 +0300 |
---|---|---|
committer | Mai Lavelle <mai.lavelle@gmail.com> | 2017-03-11 13:39:28 +0300 |
commit | 96868a39419f1c9a8962c56e02480fabbf1e5156 (patch) | |
tree | 64128db60a690d0223dad4e6e4073230ffd174ac /intern/cycles/device/device_memory.h | |
parent | 5afe4c787f0ed3ac30f7609c7f07c5092a20eac9 (diff) |
Fix T50888: Numeric overflow in split kernel state buffer size calculation
Overflow led to the state buffer being too small and the split kernel to
get stuck doing nothing forever.
Diffstat (limited to 'intern/cycles/device/device_memory.h')
-rw-r--r-- | intern/cycles/device/device_memory.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/intern/cycles/device/device_memory.h b/intern/cycles/device/device_memory.h index b69c3dad604..60d166b43ba 100644 --- a/intern/cycles/device/device_memory.h +++ b/intern/cycles/device/device_memory.h @@ -48,7 +48,8 @@ enum DataType { TYPE_UINT, TYPE_INT, TYPE_FLOAT, - TYPE_HALF + TYPE_HALF, + TYPE_UINT64, }; static inline size_t datatype_size(DataType datatype) @@ -59,6 +60,7 @@ static inline size_t datatype_size(DataType datatype) case TYPE_UINT: return sizeof(uint); case TYPE_INT: return sizeof(int); case TYPE_HALF: return sizeof(half); + case TYPE_UINT64: return sizeof(uint64_t); default: return 0; } } @@ -160,6 +162,11 @@ template<> struct device_type_traits<half4> { static const int num_elements = 4; }; +template<> struct device_type_traits<uint64_t> { + static const DataType data_type = TYPE_UINT64; + static const int num_elements = 1; +}; + /* Device Memory */ class device_memory |