Optimize CPU particles impl parts

This commit is contained in:
Wojtek Figat
2021-08-30 20:30:52 +02:00
parent e284a88da4
commit e3b98c902b
4 changed files with 11 additions and 8 deletions

View File

@@ -610,10 +610,11 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
ValueType type(GetVariantType(attribute.ValueType));
if (node->UsePerParticleDataResolve())
{
Value value;
for (int32 particleIndex = particlesStart; particleIndex < particlesEnd; particleIndex++)
{
context.ParticleIndex = particleIndex;
const Value value = GetValue(box, 4).Cast(type);
value = GetValue(box, 4).Cast(type);
Platform::MemoryCopy(dataPtr, &value.AsPointer, dataSize);
dataPtr += stride;
}
@@ -667,10 +668,11 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
ValueType type(GetVariantType(attribute.ValueType));
if (node->UsePerParticleDataResolve())
{
Value value;
for (int32 particleIndex = particlesStart; particleIndex < particlesEnd; particleIndex++)
{
context.ParticleIndex = particleIndex;
const Value value = GetValue(box, 2).Cast(type);
value = GetValue(box, 2).Cast(type);
Platform::MemoryCopy(dataPtr, &value.AsPointer, dataSize);
dataPtr += stride;
}