2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 07:07:42 +00:00

Combine CommitResources for CBooRenderer::UpdateAreaUniforms.

This shares the IGraphicsDataFactory::Context over many functions, to avoid
the overhead of calling CGraphics::CommitResources multiple times.
This commit is contained in:
Henrique Gemignani Passos Lima
2021-04-04 01:01:23 +03:00
committed by Luke Street
parent 05d8ab688e
commit e3896bdee9
3 changed files with 26 additions and 16 deletions

View File

@@ -796,14 +796,17 @@ void CBooRenderer::UpdateAreaUniforms(int areaIdx, EWorldShadowMode shadowMode,
if (shadowMode == EWorldShadowMode::BallOnWorldShadow || shadowMode == EWorldShadowMode::BallOnWorldIds)
continue;
for (auto it = item.x10_models.begin(); it != item.x10_models.end(); ++it) {
CBooModel* model = *it;
if (model->TryLockTextures()) {
if (activateLights)
ActivateLightsForModel(&item, *model);
model->UpdateUniformData(flags, nullptr, nullptr, bufIdx);
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
for (auto it = item.x10_models.begin(); it != item.x10_models.end(); ++it) {
CBooModel* model = *it;
if (model->TryLockTextures()) {
if (activateLights)
ActivateLightsForModel(&item, *model);
model->UpdateUniformData(flags, nullptr, nullptr, bufIdx, &ctx);
}
}
}
return true;
} BooTrace);
}
}