Remove DwmFlush()
This commit is contained in:
@@ -109,7 +109,6 @@ namespace platf::dxgi {
|
||||
public:
|
||||
dup_t dup;
|
||||
bool has_frame {};
|
||||
bool use_dwmflush {};
|
||||
std::chrono::steady_clock::time_point last_protected_content_warning_time {};
|
||||
|
||||
capture_e
|
||||
|
||||
@@ -32,10 +32,6 @@ namespace platf::dxgi {
|
||||
return capture_status;
|
||||
}
|
||||
|
||||
if (use_dwmflush) {
|
||||
DwmFlush();
|
||||
}
|
||||
|
||||
auto status = dup->AcquireNextFrame(timeout.count(), &frame_info, res_p);
|
||||
|
||||
switch (status) {
|
||||
@@ -470,21 +466,6 @@ namespace platf::dxgi {
|
||||
<< "Offset : "sv << offset_x << 'x' << offset_y << std::endl
|
||||
<< "Virtual Desktop : "sv << env_width << 'x' << env_height;
|
||||
|
||||
// Enable DwmFlush() only if the current refresh rate can match the client framerate.
|
||||
auto refresh_rate = config.framerate;
|
||||
DWM_TIMING_INFO timing_info;
|
||||
timing_info.cbSize = sizeof(timing_info);
|
||||
|
||||
status = DwmGetCompositionTimingInfo(NULL, &timing_info);
|
||||
if (FAILED(status)) {
|
||||
BOOST_LOG(warning) << "Failed to detect active refresh rate.";
|
||||
}
|
||||
else {
|
||||
refresh_rate = std::round((double) timing_info.rateRefresh.uiNumerator / (double) timing_info.rateRefresh.uiDenominator);
|
||||
}
|
||||
|
||||
dup.use_dwmflush = config::video.dwmflush && !(config.framerate > refresh_rate) ? true : false;
|
||||
|
||||
// Bump up thread priority
|
||||
{
|
||||
const DWORD flags = TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY;
|
||||
|
||||
Reference in New Issue
Block a user