feat: add particle static CPU fast path
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
This commit is contained in:
@@ -29,6 +29,9 @@ enum class RendererDebugCounter : uint8_t {
|
||||
RetainedUnderlayInvalidation,
|
||||
RetainedUnderlayStaticGroupDraw,
|
||||
RetainedDynamicGroupDraw,
|
||||
ParticleFastFrameHit,
|
||||
ParticleFastFrameMiss,
|
||||
ParticleFullFrame,
|
||||
Count,
|
||||
};
|
||||
|
||||
@@ -54,6 +57,9 @@ struct RendererDebugCounterSnapshot {
|
||||
uint64_t retainedUnderlayInvalidation = 0;
|
||||
uint64_t retainedUnderlayStaticGroupDraw = 0;
|
||||
uint64_t retainedDynamicGroupDraw = 0;
|
||||
uint64_t particleFastFrameHit = 0;
|
||||
uint64_t particleFastFrameMiss = 0;
|
||||
uint64_t particleFullFrame = 0;
|
||||
};
|
||||
|
||||
inline std::atomic_uint64_t* rendererDebugCounterStorage() {
|
||||
@@ -67,16 +73,34 @@ inline void incrementRendererDebugCounter(const RendererDebugCounter counter) {
|
||||
|
||||
inline RendererDebugCounterSnapshot rendererDebugCounterSnapshot() {
|
||||
const auto* values = rendererDebugCounterStorage();
|
||||
return {values[0].load(std::memory_order_relaxed), values[1].load(std::memory_order_relaxed),
|
||||
values[2].load(std::memory_order_relaxed), values[3].load(std::memory_order_relaxed),
|
||||
values[4].load(std::memory_order_relaxed), values[5].load(std::memory_order_relaxed),
|
||||
values[6].load(std::memory_order_relaxed), values[7].load(std::memory_order_relaxed),
|
||||
values[8].load(std::memory_order_relaxed), values[9].load(std::memory_order_relaxed),
|
||||
values[10].load(std::memory_order_relaxed), values[11].load(std::memory_order_relaxed),
|
||||
values[12].load(std::memory_order_relaxed), values[13].load(std::memory_order_relaxed),
|
||||
values[14].load(std::memory_order_relaxed), values[15].load(std::memory_order_relaxed),
|
||||
values[16].load(std::memory_order_relaxed), values[17].load(std::memory_order_relaxed),
|
||||
values[18].load(std::memory_order_relaxed), values[19].load(std::memory_order_relaxed)};
|
||||
RendererDebugCounterSnapshot result;
|
||||
#define MLN_LOAD_RENDERER_COUNTER(field, counter) \
|
||||
result.field = values[static_cast<size_t>(RendererDebugCounter::counter)].load(std::memory_order_relaxed)
|
||||
MLN_LOAD_RENDERER_COUNTER(weatherColorNeedsRepaint, WeatherColorNeedsRepaint);
|
||||
MLN_LOAD_RENDERER_COUNTER(particleNeedsRepaint, ParticleNeedsRepaint);
|
||||
MLN_LOAD_RENDERER_COUNTER(weatherColorUpdate, WeatherColorUpdate);
|
||||
MLN_LOAD_RENDERER_COUNTER(particleUpdate, ParticleUpdate);
|
||||
MLN_LOAD_RENDERER_COUNTER(particleSimulationAdvance, ParticleSimulationAdvance);
|
||||
MLN_LOAD_RENDERER_COUNTER(weatherColorDrawableRebuild, WeatherColorDrawableRebuild);
|
||||
MLN_LOAD_RENDERER_COUNTER(particleDrawableRebuild, ParticleDrawableRebuild);
|
||||
MLN_LOAD_RENDERER_COUNTER(fieldTextureUpload, FieldTextureUpload);
|
||||
MLN_LOAD_RENDERER_COUNTER(gpuResourceCreate, GpuResourceCreate);
|
||||
MLN_LOAD_RENDERER_COUNTER(gpuResourceRelease, GpuResourceRelease);
|
||||
MLN_LOAD_RENDERER_COUNTER(trailTargetCreateOrResize, TrailTargetCreateOrResize);
|
||||
MLN_LOAD_RENDERER_COUNTER(v4ProjectionMaterialize, V4ProjectionMaterialize);
|
||||
MLN_LOAD_RENDERER_COUNTER(fieldWindowRevision, FieldWindowRevision);
|
||||
MLN_LOAD_RENDERER_COUNTER(fullRendererFrame, FullRendererFrame);
|
||||
MLN_LOAD_RENDERER_COUNTER(retainedUnderlayBuild, RetainedUnderlayBuild);
|
||||
MLN_LOAD_RENDERER_COUNTER(retainedUnderlayReuse, RetainedUnderlayReuse);
|
||||
MLN_LOAD_RENDERER_COUNTER(retainedUnderlayFallback, RetainedUnderlayFallback);
|
||||
MLN_LOAD_RENDERER_COUNTER(retainedUnderlayInvalidation, RetainedUnderlayInvalidation);
|
||||
MLN_LOAD_RENDERER_COUNTER(retainedUnderlayStaticGroupDraw, RetainedUnderlayStaticGroupDraw);
|
||||
MLN_LOAD_RENDERER_COUNTER(retainedDynamicGroupDraw, RetainedDynamicGroupDraw);
|
||||
MLN_LOAD_RENDERER_COUNTER(particleFastFrameHit, ParticleFastFrameHit);
|
||||
MLN_LOAD_RENDERER_COUNTER(particleFastFrameMiss, ParticleFastFrameMiss);
|
||||
MLN_LOAD_RENDERER_COUNTER(particleFullFrame, ParticleFullFrame);
|
||||
#undef MLN_LOAD_RENDERER_COUNTER
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
inline void incrementRendererDebugCounter(RendererDebugCounter) {}
|
||||
|
||||
Reference in New Issue
Block a user