| 160 | } |
| 161 | |
| 162 | void Instance::convertToDeviceRepresentation(size_t offset, char* data_host, char* data_device) const { |
| 163 | // save offset for later when overriding local2world with device ptr |
| 164 | size_t offsetInstance = offset; |
| 165 | |
| 166 | std::memcpy(data_host + offsetInstance, (void*)this, sizeof(Instance)); |
| 167 | offset += sizeof(Instance); |
| 168 | for (size_t t = 0; t < numTimeSteps; ++t) { |
| 169 | std::memcpy(data_host + offset, &(local2world[t]), sizeof(AffineSpace3ff)); |
| 170 | offset += sizeof(AffineSpace3ff); |
| 171 | } |
| 172 | |
| 173 | // override local2world value with device ptr in geometry_data_host |
| 174 | Instance* instance = (Instance*)(data_host + offsetInstance); |
| 175 | instance->object = ((Scene*)(instance->object))->getTraversable(); |
| 176 | instance->local2world = (AffineSpace3ff*)(data_device + offsetInstance + sizeof(Instance)); |
| 177 | } |
| 178 | |
| 179 | /* |
| 180 |
nothing calls this directly
no test coverage detected