! sets the buffer view */
| 247 | public: |
| 248 | /*! sets the buffer view */ |
| 249 | void set(const Ref<Buffer>& buffer_in, size_t offset_in, size_t stride_in, size_t num_in, RTCFormat format_in) |
| 250 | { |
| 251 | if (stride_in > 0xFFFFFFFFu) { |
| 252 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT,"stride too large"); |
| 253 | } |
| 254 | |
| 255 | if (num_in > 0xFFFFFFFFu) { |
| 256 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT,"item count too large"); |
| 257 | } |
| 258 | |
| 259 | if (offset_in > buffer_in->numBytes) { |
| 260 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "offset too large"); |
| 261 | } |
| 262 | |
| 263 | if (stride_in * num_in > buffer_in->numBytes - offset_in) { |
| 264 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "buffer range out of bounds"); |
| 265 | } |
| 266 | |
| 267 | ptr_ofs = buffer_in->getHostPtr() + offset_in; |
| 268 | dptr_ofs = buffer_in->getDevicePtr() + offset_in; |
| 269 | stride = stride_in; |
| 270 | num = num_in; |
| 271 | format = format_in; |
| 272 | modCounter++; |
| 273 | modified = true; |
| 274 | buffer = buffer_in; |
| 275 | } |
| 276 | |
| 277 | /*! returns pointer to the i'th element */ |
| 278 | __forceinline char* getPtr(BufferDataPointerType pointerType) const |
nothing calls this directly
no test coverage detected