mirror of https://github.com/AxioDL/metaforce.git
Don't recreate every pipeline in CElementGen, only those relevent to CParticle instances
This commit is contained in:
parent
54691cf035
commit
518e639f69
|
@ -214,6 +214,10 @@ CElementGen::CElementGen(TToken<CGenDescription> gen, EModelOrientationType orie
|
||||||
}
|
}
|
||||||
|
|
||||||
_RecreatePipelines();
|
_RecreatePipelines();
|
||||||
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
|
||||||
|
CElementGenShaders::BuildShaderDataBinding(ctx, *this);
|
||||||
|
return true;
|
||||||
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
CElementGen::~CElementGen() {
|
CElementGen::~CElementGen() {
|
||||||
|
@ -231,14 +235,14 @@ bool CElementGen::Update(double t) {
|
||||||
if (pswtElem && !x26d_25_warmedUp) {
|
if (pswtElem && !x26d_25_warmedUp) {
|
||||||
int pswt = 0;
|
int pswt = 0;
|
||||||
pswtElem->GetValue(x74_curFrame, pswt);
|
pswtElem->GetValue(x74_curFrame, pswt);
|
||||||
//Log.report(logvisor::Info, FMT_STRING("Running warmup on particle system 0x%08x for %d ticks."), desc, pswt);
|
// Log.report(logvisor::Info, FMT_STRING("Running warmup on particle system 0x%08x for %d ticks."), desc, pswt);
|
||||||
InternalUpdate((1.f / 60.f) * pswt);
|
InternalUpdate((1.f / 60.f) * pswt);
|
||||||
x26d_25_warmedUp = true;
|
x26d_25_warmedUp = true;
|
||||||
}
|
}
|
||||||
bool ret = InternalUpdate(t);
|
bool ret = InternalUpdate(t);
|
||||||
CParticleGlobals::instance()->m_currentParticleSystem = prevSystem;
|
CParticleGlobals::instance()->m_currentParticleSystem = prevSystem;
|
||||||
|
|
||||||
if (oldMax != x90_MAXP) {
|
if (oldMax < x90_MAXP) {
|
||||||
_RecreatePipelines();
|
_RecreatePipelines();
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -256,7 +260,6 @@ void CElementGen::_RecreatePipelines() {
|
||||||
m_instBufPmus = ctx.newDynamicBuffer(boo::BufferUse::Vertex, ShadClsSizes[size_t(m_shaderClass)], maxInsts);
|
m_instBufPmus = ctx.newDynamicBuffer(boo::BufferUse::Vertex, ShadClsSizes[size_t(m_shaderClass)], maxInsts);
|
||||||
m_uniformBufPmus = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(SParticleUniforms), 1);
|
m_uniformBufPmus = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(SParticleUniforms), 1);
|
||||||
}
|
}
|
||||||
CElementGenShaders::BuildShaderDataBinding(ctx, *this);
|
|
||||||
return true;
|
return true;
|
||||||
} BooTrace);
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
@ -828,8 +831,8 @@ void CElementGen::Render(const CActorLights* actorLights) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CElementGen::Render {}"),
|
SCOPED_GRAPHICS_DEBUG_GROUP(fmt::format(FMT_STRING("CElementGen::Render {}"), *x1c_genDesc.GetObjectTag()).c_str(),
|
||||||
*x1c_genDesc.GetObjectTag()).c_str(), zeus::skYellow);
|
zeus::skYellow);
|
||||||
|
|
||||||
CGenDescription* desc = x1c_genDesc.GetObj();
|
CGenDescription* desc = x1c_genDesc.GetObj();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue