diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-05 23:46:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-05 23:46:04 +0300 |
commit | 8dff53898965b5ea07a99245071098207d3f197e (patch) | |
tree | 6d15750b7009796ac7176bb3063145e2dc12b66b /intern/cycles/device | |
parent | 45fdf41be87fb0b2fbf85778a714537ed1f5eca3 (diff) | |
parent | 0e2915b2929aa312a03bc4d3a606bb8073fcead0 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'intern/cycles/device')
-rw-r--r-- | intern/cycles/device/device_cuda.cpp | 1 | ||||
-rw-r--r-- | intern/cycles/device/device_memory.h | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 209fe84b789..c9ec1cc1219 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -1072,6 +1072,7 @@ public: CUarray_format_enum format; switch(mem.data_type) { case TYPE_UCHAR: format = CU_AD_FORMAT_UNSIGNED_INT8; break; + case TYPE_UINT16: format = CU_AD_FORMAT_UNSIGNED_INT16; break; case TYPE_UINT: format = CU_AD_FORMAT_UNSIGNED_INT32; break; case TYPE_INT: format = CU_AD_FORMAT_SIGNED_INT32; break; case TYPE_FLOAT: format = CU_AD_FORMAT_FLOAT; break; diff --git a/intern/cycles/device/device_memory.h b/intern/cycles/device/device_memory.h index 1138964f18c..b6f3c2913a5 100644 --- a/intern/cycles/device/device_memory.h +++ b/intern/cycles/device/device_memory.h @@ -43,6 +43,7 @@ enum MemoryType { enum DataType { TYPE_UNKNOWN, TYPE_UCHAR, + TYPE_UINT16, TYPE_UINT, TYPE_INT, TYPE_FLOAT, @@ -57,6 +58,7 @@ static inline size_t datatype_size(DataType datatype) case TYPE_UCHAR: return sizeof(uchar); case TYPE_FLOAT: return sizeof(float); case TYPE_UINT: return sizeof(uint); + case TYPE_UINT16: return sizeof(uint16_t); case TYPE_INT: return sizeof(int); case TYPE_HALF: return sizeof(half); case TYPE_UINT64: return sizeof(uint64_t); @@ -156,6 +158,16 @@ template<> struct device_type_traits<half> { static const int num_elements = 1; }; +template<> struct device_type_traits<ushort4> { + static const DataType data_type = TYPE_UINT16; + static const int num_elements = 4; +}; + +template<> struct device_type_traits<uint16_t> { + static const DataType data_type = TYPE_UINT16; + static const int num_elements = 1; +}; + template<> struct device_type_traits<half4> { static const DataType data_type = TYPE_HALF; static const int num_elements = 4; |