Fix stuttering in Minecraft when moving the mouse

This commit is contained in:
loki
2020-05-01 22:04:18 +02:00
parent d8b4c66d7e
commit bfe59f6cf2
+5 -3
View File
@@ -330,9 +330,9 @@ capture_e display_vram_t::snapshot(platf::img_t *img_base, std::chrono::millisec
return capture_status;
}
const bool update_flag =
frame_info.AccumulatedFrames != 0 || frame_info.LastPresentTime.QuadPart != 0 ||
frame_info.LastMouseUpdateTime.QuadPart != 0 || frame_info.PointerShapeBufferSize > 0;
const bool mouse_update_flag = frame_info.LastMouseUpdateTime.QuadPart != 0 || frame_info.PointerShapeBufferSize > 0;
const bool frame_update_flag = frame_info.AccumulatedFrames != 0 || frame_info.LastPresentTime.QuadPart != 0;
const bool update_flag = mouse_update_flag || frame_update_flag;
if(!update_flag) {
return capture_e::timeout;
@@ -395,6 +395,7 @@ capture_e display_vram_t::snapshot(platf::img_t *img_base, std::chrono::millisec
}
}
if(frame_update_flag) {
texture2d_t::pointer src_p {};
status = res->QueryInterface(IID_ID3D11Texture2D, (void **)&src_p);
@@ -405,6 +406,7 @@ capture_e display_vram_t::snapshot(platf::img_t *img_base, std::chrono::millisec
texture2d_t src { src_p };
device_ctx->CopyResource(img->texture.get(), src.get());
}
return capture_e::ok;
}