mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
graphics: address performance regression with Image Resize (#504)
## Link to GitHub Issue, if one exists Regressed by #401 ## Description of change Two things from testing SDVX Live2D - 1. ColorFill is almost always too expensive and will lead to drops 1. Scale factor of 0.5 causes GPU to sync and causes drops (ARGB/XRGB doesn't matter, linear filtering doesn't matter) 1 is fixed by removing ColorFill calls on every frame - instead only do this once when the user changes the duplicate option (on the next frame) 2 is fixed by updating the UI (limit the slider) though people can ctrl+click to override these slider limits. The warning label will be kept with slightly reworded text. ## Testing tested in sdvx eg final (sudden death) - on my RTX 4070, my FPS is rock solid 120 fps even with image resize on now.
This commit is contained in:
@@ -742,14 +742,12 @@ void SurfaceHook(IDirect3DDevice9 *pReal) {
|
||||
const int w = param.BackBufferWidth;
|
||||
const int h = param.BackBufferHeight;
|
||||
|
||||
if (cfg::SCREENRESIZE->enable_screen_resize) {
|
||||
RECT rect {
|
||||
0,
|
||||
0,
|
||||
(LONG)topSurface_width,
|
||||
(LONG)topSurface_height,
|
||||
};
|
||||
pReal->ColorFill(topSurface, &rect, D3DCOLOR_XRGB(0, 0, 0));
|
||||
// this code used to clear the surface using ColorFill on every call, but
|
||||
// this turned out to be very expensive, leading to major frame drops in
|
||||
// SDVX Live2D scenario
|
||||
if (cfg::SCREENRESIZE->need_surface_clean) {
|
||||
pReal->ColorFill(topSurface, nullptr, D3DCOLOR_XRGB(0, 0, 0));
|
||||
cfg::SCREENRESIZE->need_surface_clean = false;
|
||||
}
|
||||
|
||||
D3DLOCKED_RECT rect;
|
||||
|
||||
Reference in New Issue
Block a user