@@ -131,7 +131,7 @@ namespace
131
131
uint32_t outputOffset_;
132
132
uint16_t outputPaddingSize_;
133
133
};
134
- template <uint64_t PmNsmPresentEvent::* pStart, uint64_t PmNsmPresentEvent::* pEnd, bool doZeroCheck, bool doDroppedCheck, bool allowNegative, bool clampZero >
134
+ template <uint64_t PmNsmPresentEvent::* pStart, uint64_t PmNsmPresentEvent::* pEnd, bool doZeroCheck, bool doDroppedCheck, bool allowNegative>
135
135
class QpcDifferenceGatherCommand_ : public pmon ::mid::GatherCommand_
136
136
{
137
137
public:
@@ -142,7 +142,6 @@ namespace
142
142
}
143
143
void Gather (const Context& ctx, uint8_t * pDestBlob) const override
144
144
{
145
- static_assert (!allowNegative || !clampZero);
146
145
if constexpr (doDroppedCheck) {
147
146
if (ctx.dropped ) {
148
147
reinterpret_cast <double &>(pDestBlob[outputOffset_]) =
@@ -158,11 +157,8 @@ namespace
158
157
return ;
159
158
}
160
159
}
161
- if constexpr (allowNegative || clampZero ) {
160
+ if constexpr (allowNegative) {
162
161
auto qpcDurationDouble = double (ctx.pSourceFrameData ->present_event .*pEnd) - double (start);
163
- if constexpr (clampZero) {
164
- qpcDurationDouble = std::max (0 ., qpcDurationDouble);
165
- }
166
162
const auto val = ctx.performanceCounterPeriodMs * qpcDurationDouble;
167
163
reinterpret_cast <double &>(pDestBlob[outputOffset_]) = val;
168
164
}
@@ -553,7 +549,7 @@ std::unique_ptr<mid::GatherCommand_> PM_FRAME_QUERY::MapQueryElementToGatherComm
553
549
case PM_METRIC_CPU_WAIT:
554
550
return std::make_unique<QpcDurationGatherCommand_<&Pre::TimeInPresent>>(pos);
555
551
case PM_METRIC_GPU_TIME:
556
- return std::make_unique<QpcDifferenceGatherCommand_<&Pre::GPUStartTime, &Pre::ReadyTime, 0 , 0 , 0 , 0 >>(pos);
552
+ return std::make_unique<QpcDifferenceGatherCommand_<&Pre::GPUStartTime, &Pre::ReadyTime, 0 , 0 , 0 >>(pos);
557
553
case PM_METRIC_GPU_WAIT:
558
554
return std::make_unique<GpuWaitGatherCommand_>(pos);
559
555
case PM_METRIC_DISPLAYED_TIME:
@@ -563,7 +559,7 @@ std::unique_ptr<mid::GatherCommand_> PM_FRAME_QUERY::MapQueryElementToGatherComm
563
559
case PM_METRIC_DISPLAY_LATENCY:
564
560
return std::make_unique<CpuFrameQpcDifferenceGatherCommand_<&Pre::ScreenTime, 1 >>(pos);
565
561
case PM_METRIC_CLICK_TO_PHOTON_LATENCY:
566
- return std::make_unique<QpcDifferenceGatherCommand_<&Pre::InputTime, &Pre::ScreenTime, 1 , 1 , 0 , 0 >>(pos);
562
+ return std::make_unique<QpcDifferenceGatherCommand_<&Pre::InputTime, &Pre::ScreenTime, 1 , 1 , 0 >>(pos);
567
563
568
564
default : return {};
569
565
}
0 commit comments