Fix stuttering in Minecraft when moving the mouse
This commit is contained in:
@@ -330,9 +330,9 @@ capture_e display_vram_t::snapshot(platf::img_t *img_base, std::chrono::millisec
|
|||||||
return capture_status;
|
return capture_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool update_flag =
|
const bool mouse_update_flag = frame_info.LastMouseUpdateTime.QuadPart != 0 || frame_info.PointerShapeBufferSize > 0;
|
||||||
frame_info.AccumulatedFrames != 0 || frame_info.LastPresentTime.QuadPart != 0 ||
|
const bool frame_update_flag = frame_info.AccumulatedFrames != 0 || frame_info.LastPresentTime.QuadPart != 0;
|
||||||
frame_info.LastMouseUpdateTime.QuadPart != 0 || frame_info.PointerShapeBufferSize > 0;
|
const bool update_flag = mouse_update_flag || frame_update_flag;
|
||||||
|
|
||||||
if(!update_flag) {
|
if(!update_flag) {
|
||||||
return capture_e::timeout;
|
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 {};
|
texture2d_t::pointer src_p {};
|
||||||
status = res->QueryInterface(IID_ID3D11Texture2D, (void **)&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 };
|
texture2d_t src { src_p };
|
||||||
device_ctx->CopyResource(img->texture.get(), src.get());
|
device_ctx->CopyResource(img->texture.get(), src.get());
|
||||||
|
}
|
||||||
|
|
||||||
return capture_e::ok;
|
return capture_e::ok;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user