| 135 | } |
| 136 | |
| 137 | void GridMesh::commit() |
| 138 | { |
| 139 | /* verify that stride of all time steps are identical */ |
| 140 | for (unsigned int t=0; t<numTimeSteps; t++) { |
| 141 | if (vertices[t].getStride() != vertices[0].getStride()) |
| 142 | throw_RTCError(RTC_ERROR_INVALID_OPERATION,"stride of vertex buffers have to be identical for each time step"); |
| 143 | if (vertices[t]) vertices[t].buffer->commitIfNeeded(); |
| 144 | } |
| 145 | if (grids) { |
| 146 | /* Verify that grid sizes are in bounds */ |
| 147 | for (size_t primID=0; primID<numPrimitives; primID++) { |
| 148 | const Grid& g = grid(primID); |
| 149 | if (g.resX > maxGridRes || g.resY > maxGridRes) { |
| 150 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "grid dimensions are too big"); |
| 151 | } |
| 152 | |
| 153 | } |
| 154 | grids.buffer->commitIfNeeded(); |
| 155 | } |
| 156 | #if defined(EMBREE_SYCL_SUPPORT) |
| 157 | |
| 158 | /* build quadID_to_primID_xy mapping when hardware ray tracing is supported */ |
| 159 | DeviceGPU* gpu_device = dynamic_cast<DeviceGPU*>(device); |
| 160 | if (gpu_device) |
| 161 | { |
| 162 | const size_t numQuads = getNumTotalQuads(); |
| 163 | quadID_to_primID_xy.resize(numQuads); |
| 164 | |
| 165 | for (uint32_t primID=0, quadID=0; primID<size(); primID++) |
| 166 | { |
| 167 | const Grid& g = grid(primID); |
| 168 | for (ssize_t y=0; y<ssize_t(g.resY)-1; y++) |
| 169 | for (ssize_t x=0; x<ssize_t(g.resX)-1; x++) |
| 170 | quadID_to_primID_xy[quadID++] = { primID, (uint16_t) x, (uint16_t) y }; |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | #endif |
| 175 | |
| 176 | Geometry::commit(); |
| 177 | } |
| 178 | |
| 179 | void GridMesh::addElementsToCount (GeometryCounts& counts) const |
| 180 | { |
nothing calls this directly
no test coverage detected