feat: add particle static CPU fast path
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled

This commit is contained in:
tei
2026-09-23 08:22:24 +09:00
parent 98e1d2d977
commit 4e3d27e1f3
18 changed files with 1247 additions and 38 deletions

View File

@@ -1102,10 +1102,7 @@ void RenderRasterParticleLayer::evaluate(const PropertyEvaluationParameters&) {
}
bool RenderRasterParticleLayer::needsRepaint() const {
const auto& properties = static_cast<const style::ParticleRenderLayerProperties&>(*evaluatedProperties);
if (!properties.active || (formalSource && (!sourceField || !sourceNextField)) ||
baseImpl->visibility == style::VisibilityType::None)
return false;
if (!isParticleAnimationActive()) return false;
const bool repaint = !formalSource ||
(sourceUsesV4Projection
? sourceV4Cadence && sourceV4Cadence->cadenceDue(std::chrono::steady_clock::now())
@@ -1114,6 +1111,14 @@ bool RenderRasterParticleLayer::needsRepaint() const {
return repaint;
}
bool RenderRasterParticleLayer::isParticleAnimationActive() const {
const auto& properties = static_cast<const style::ParticleRenderLayerProperties&>(*evaluatedProperties);
if (!properties.active || (formalSource && (!sourceField || !sourceNextField)) ||
baseImpl->visibility == style::VisibilityType::None)
return false;
return true;
}
bool RenderRasterParticleLayer::needsHiddenLayerSourceCleanup(const RenderSource& renderSource) const {
if (!formalSource || !gpuResources || renderSource.baseImpl->type != style::SourceType::RasterArray) return false;
const auto& source = static_cast<const RenderRasterArraySource&>(renderSource);