@@ -477,6 +477,7 @@ namespace
477477 uint32_t outputOffset_;
478478 uint16_t outputPaddingSize_;
479479 };
480+ template <bool doDroppedCheck, bool doZeroCheck>
480481 class AnimationErrorGatherCommand_ : public pmon ::mid::GatherCommand_
481482 {
482483 public:
@@ -487,15 +488,18 @@ namespace
487488 }
488489 void Gather (Context& ctx, uint8_t * pDestBlob) const override
489490 {
490- if (ctx.dropped ) {
491- reinterpret_cast <double &>(pDestBlob[outputOffset_]) =
492- std::numeric_limits<double >::quiet_NaN ();
493- return ;
491+ if constexpr (doDroppedCheck) {
492+ if (ctx.dropped ) {
493+ reinterpret_cast <double &>(pDestBlob[outputOffset_]) =
494+ std::numeric_limits<double >::quiet_NaN ();
495+ return ;
496+ }
494497 }
495- if (ctx.previousDisplayedCpuStartQpc == 0 ) {
496- reinterpret_cast <double &>(pDestBlob[outputOffset_]) =
497- std::numeric_limits<double >::quiet_NaN ();
498- return ;
498+ if constexpr (doZeroCheck) {
499+ if (ctx.previousDisplayedCpuStartQpc == 0 ) {
500+ reinterpret_cast <double &>(pDestBlob[outputOffset_]) = 0.0 ;
501+ return ;
502+ }
499503 }
500504 if (ctx.sourceFrameDisplayIndex == ctx.appIndex && ctx.previousDisplayedCpuStartQpc != 0 ) {
501505 auto ScreenTime = ctx.pSourceFrameData ->present_event .Displayed_ScreenTime [ctx.sourceFrameDisplayIndex ];
@@ -832,7 +836,7 @@ std::unique_ptr<mid::GatherCommand_> PM_FRAME_QUERY::MapQueryElementToGatherComm
832836 case PM_METRIC_DISPLAYED_TIME:
833837 return std::make_unique<DisplayDifferenceGatherCommand_>(pos);
834838 case PM_METRIC_ANIMATION_ERROR:
835- return std::make_unique<AnimationErrorGatherCommand_>(pos);
839+ return std::make_unique<AnimationErrorGatherCommand_< 1 , 1 > >(pos);
836840 case PM_METRIC_GPU_LATENCY:
837841 return std::make_unique<CpuFrameQpcDifferenceGatherCommand_<&Pre::GPUStartTime, 0 >>(pos);
838842 case PM_METRIC_DISPLAY_LATENCY:
0 commit comments