Skip to content

Commit 9e95585

Browse files
planetchilimarkgalvan-intel
authored andcommitted
remove some redundancy
1 parent 294ba23 commit 9e95585

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

IntelPresentMon/PresentMonMiddleware/source/FrameEventQuery.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ namespace
131131
uint32_t outputOffset_;
132132
uint16_t outputPaddingSize_;
133133
};
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>
135135
class QpcDifferenceGatherCommand_ : public pmon::mid::GatherCommand_
136136
{
137137
public:
@@ -142,7 +142,6 @@ namespace
142142
}
143143
void Gather(const Context& ctx, uint8_t* pDestBlob) const override
144144
{
145-
static_assert(!allowNegative || !clampZero);
146145
if constexpr (doDroppedCheck) {
147146
if (ctx.dropped) {
148147
reinterpret_cast<double&>(pDestBlob[outputOffset_]) =
@@ -158,11 +157,8 @@ namespace
158157
return;
159158
}
160159
}
161-
if constexpr (allowNegative || clampZero) {
160+
if constexpr (allowNegative) {
162161
auto qpcDurationDouble = double(ctx.pSourceFrameData->present_event.*pEnd) - double(start);
163-
if constexpr (clampZero) {
164-
qpcDurationDouble = std::max(0., qpcDurationDouble);
165-
}
166162
const auto val = ctx.performanceCounterPeriodMs * qpcDurationDouble;
167163
reinterpret_cast<double&>(pDestBlob[outputOffset_]) = val;
168164
}
@@ -553,7 +549,7 @@ std::unique_ptr<mid::GatherCommand_> PM_FRAME_QUERY::MapQueryElementToGatherComm
553549
case PM_METRIC_CPU_WAIT:
554550
return std::make_unique<QpcDurationGatherCommand_<&Pre::TimeInPresent>>(pos);
555551
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);
557553
case PM_METRIC_GPU_WAIT:
558554
return std::make_unique<GpuWaitGatherCommand_>(pos);
559555
case PM_METRIC_DISPLAYED_TIME:
@@ -563,7 +559,7 @@ std::unique_ptr<mid::GatherCommand_> PM_FRAME_QUERY::MapQueryElementToGatherComm
563559
case PM_METRIC_DISPLAY_LATENCY:
564560
return std::make_unique<CpuFrameQpcDifferenceGatherCommand_<&Pre::ScreenTime, 1>>(pos);
565561
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);
567563

568564
default: return {};
569565
}

0 commit comments

Comments
 (0)