| 228 | } |
| 229 | |
| 230 | utility::ArrayView<uint32_t> LocalFrameBuffer::getRenderTaskIDs( |
| 231 | const float errorThreshold_, const uint32_t spp) |
| 232 | { |
| 233 | if (accumulationFinished()) |
| 234 | return utility::ArrayView<uint32_t>(); |
| 235 | |
| 236 | errorThreshold = errorThreshold_; // remember |
| 237 | if (errorThreshold > 0.0f && varianceFrameOp |
| 238 | && (getFrameID() >= minimumAdaptiveFrames(spp))) { |
| 239 | // Select render tasks that needs to be processed |
| 240 | auto last = std::copy_if(renderTaskIDs->begin(), |
| 241 | renderTaskIDs->end(), |
| 242 | activeTaskIDs->begin(), |
| 243 | [=](uint32_t i) { |
| 244 | return varianceFrameOp->getError(i) > errorThreshold; |
| 245 | }); |
| 246 | |
| 247 | activeTaskIDs->copyToDevice(); |
| 248 | const size_t numActive = last - activeTaskIDs->begin(); |
| 249 | return utility::ArrayView<uint32_t>(activeTaskIDs->devicePtr(), numActive); |
| 250 | } else |
| 251 | return utility::ArrayView<uint32_t>( |
| 252 | renderTaskIDs->devicePtr(), renderTaskIDs->size()); |
| 253 | } |
| 254 | |
| 255 | float LocalFrameBuffer::getVariance() const |
| 256 | { |
no test coverage detected