| 22 | } |
| 23 | |
| 24 | void CPUBuffer::UploadData(void const * data, uint32_t elementCount) |
| 25 | { |
| 26 | CHECK(elementCount == 0 || data != nullptr, (elementCount)); |
| 27 | uint32_t byteCountToCopy = GetElementSize() * elementCount; |
| 28 | #ifdef DEBUG |
| 29 | // Memory check |
| 30 | ASSERT(GetCursor() + byteCountToCopy <= Data() + m_memory->size(), ()); |
| 31 | #endif |
| 32 | |
| 33 | memcpy(GetCursor(), data, byteCountToCopy); |
| 34 | TBase::UploadData(elementCount); |
| 35 | } |
| 36 | |
| 37 | void CPUBuffer::Seek(uint32_t elementNumber) |
| 38 | { |