| 1122 | } |
| 1123 | |
| 1124 | IScene::UpdateFlags Scene::updateSDFGrids(RenderContext* pRenderContext) |
| 1125 | { |
| 1126 | IScene::UpdateFlags updateFlags = IScene::UpdateFlags::None; |
| 1127 | if (!is_set(mGeometryTypes, GeometryTypeFlags::SDFGrid)) return updateFlags; |
| 1128 | |
| 1129 | auto sdfGridsVar = mpSceneBlock->getRootVar()[kSDFGridsArrayName]; |
| 1130 | |
| 1131 | for (uint32_t sdfGridID = 0; sdfGridID < mSDFGrids.size(); ++sdfGridID) |
| 1132 | { |
| 1133 | ref<SDFGrid>& pSDFGrid = mSDFGrids[sdfGridID]; |
| 1134 | if (pSDFGrid->mpDevice != mpDevice) |
| 1135 | FALCOR_THROW("SDFGrid '{}' was created with a different device than the Scene", pSDFGrid->getName()); |
| 1136 | SDFGrid::UpdateFlags sdfGridUpdateFlags = pSDFGrid->update(pRenderContext); |
| 1137 | |
| 1138 | if (is_set(sdfGridUpdateFlags, SDFGrid::UpdateFlags::AABBsChanged)) |
| 1139 | { |
| 1140 | updateGeometryStats(); |
| 1141 | |
| 1142 | // Clear any previous BLAS data. This will trigger a full BLAS/TLAS rebuild. |
| 1143 | // TODO: Support partial rebuild of just the procedural primitives. |
| 1144 | mBlasDataValid = false; |
| 1145 | updateFlags |= IScene::UpdateFlags::SDFGeometryChanged; |
| 1146 | } |
| 1147 | |
| 1148 | if (is_set(sdfGridUpdateFlags, SDFGrid::UpdateFlags::BuffersReallocated)) |
| 1149 | { |
| 1150 | updateGeometryStats(); |
| 1151 | pSDFGrid->bindShaderData(sdfGridsVar[sdfGridID]); |
| 1152 | updateFlags |= IScene::UpdateFlags::SDFGeometryChanged; |
| 1153 | } |
| 1154 | } |
| 1155 | |
| 1156 | return updateFlags; |
| 1157 | } |
| 1158 | |
| 1159 | IScene::UpdateFlags Scene::updateProceduralPrimitives(bool forceUpdate) |
| 1160 | { |
nothing calls this directly
no test coverage detected