mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 12:33:05 +02:00
collect hard-coded time budgets in one spot
This commit is contained in:
parent
ffe16a754e
commit
500f381827
2 changed files with 4 additions and 2 deletions
|
@ -318,7 +318,6 @@ void EntityTreeRenderer::updateChangedEntities(const render::ScenePointer& scene
|
||||||
}
|
}
|
||||||
|
|
||||||
float expectedUpdateCost = _avgRenderableUpdateCost * _renderablesToUpdate.size();
|
float expectedUpdateCost = _avgRenderableUpdateCost * _renderablesToUpdate.size();
|
||||||
const float MAX_UPDATE_RENDERABLES_TIME_BUDGET = 2 * USECS_PER_MSEC;
|
|
||||||
if (expectedUpdateCost < MAX_UPDATE_RENDERABLES_TIME_BUDGET) {
|
if (expectedUpdateCost < MAX_UPDATE_RENDERABLES_TIME_BUDGET) {
|
||||||
// we expect to update all renderables within available time budget
|
// we expect to update all renderables within available time budget
|
||||||
PROFILE_RANGE_EX(simulation_physics, "UpdateRenderables", 0xffff00ff, (uint64_t)_renderablesToUpdate.size());
|
PROFILE_RANGE_EX(simulation_physics, "UpdateRenderables", 0xffff00ff, (uint64_t)_renderablesToUpdate.size());
|
||||||
|
@ -367,7 +366,6 @@ void EntityTreeRenderer::updateChangedEntities(const render::ScenePointer& scene
|
||||||
|
|
||||||
// compute remaining time budget
|
// compute remaining time budget
|
||||||
uint64_t updateStart = usecTimestampNow();
|
uint64_t updateStart = usecTimestampNow();
|
||||||
const uint64_t MIN_SORTED_UPDATE_RENDERABLES_TIME_BUDGET = 1 * USECS_PER_MSEC;
|
|
||||||
uint64_t timeBudget = MIN_SORTED_UPDATE_RENDERABLES_TIME_BUDGET;
|
uint64_t timeBudget = MIN_SORTED_UPDATE_RENDERABLES_TIME_BUDGET;
|
||||||
uint64_t sortCost = updateStart - sortStart;
|
uint64_t sortCost = updateStart - sortStart;
|
||||||
if (sortCost < MAX_UPDATE_RENDERABLES_TIME_BUDGET - MIN_SORTED_UPDATE_RENDERABLES_TIME_BUDGET) {
|
if (sortCost < MAX_UPDATE_RENDERABLES_TIME_BUDGET - MIN_SORTED_UPDATE_RENDERABLES_TIME_BUDGET) {
|
||||||
|
|
|
@ -133,5 +133,9 @@ namespace PrioritySortUtil {
|
||||||
};
|
};
|
||||||
} // namespace PrioritySortUtil
|
} // namespace PrioritySortUtil
|
||||||
|
|
||||||
|
// for now we're keeping hard-coded sorted time budgets in one spot
|
||||||
|
const uint64_t MAX_UPDATE_RENDERABLES_TIME_BUDGET = 2000; // usec
|
||||||
|
const uint64_t MIN_SORTED_UPDATE_RENDERABLES_TIME_BUDGET = 1000; // usec
|
||||||
|
|
||||||
#endif // hifi_PrioritySortUtil_h
|
#endif // hifi_PrioritySortUtil_h
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue