Add parallelsoftware cvar

In the rare case where kernel thread scheduling causes hitching issues
(SteamOS?), there should be an option to dynamically toggle multithread
dispatch of plane drawing.
This commit is contained in:
Eidolon 2024-01-29 19:21:43 -06:00
parent d40097426e
commit 591af1ab95
4 changed files with 6 additions and 1 deletions

View file

@ -423,6 +423,7 @@ consvar_t cv_pauseifunfocused = Player("pauseifunfocused", "Yes").yes_no();
extern CV_PossibleValue_t cv_renderer_t[];
consvar_t cv_renderer = Player("renderer", "Software").flags(CV_NOLUA).values(cv_renderer_t).onchange(SCR_ChangeRenderer);
consvar_t cv_parallelsoftware = Player("parallelsoftware", "On").on_off();
consvar_t cv_renderview = Player("renderview", "On").on_off().dont_save();
consvar_t cv_rollingdemos = Player("rollingdemos", "On").on_off();

View file

@ -59,6 +59,9 @@ menuitem_t OPTIONS_Video[] =
{IT_STRING | IT_CVAR, "Enable Skyboxes", "Turning this off may improve performance, but reduces courses' background details.",
NULL, {.cvar = &cv_skybox}, 0, 0},
{IT_STRING | IT_CVAR, "Parallel Software", "Uses multiple CPU cores for the software renderer if available, for a FPS boost.",
NULL, {.cvar = &cv_parallelsoftware}, 0, 0},
#ifdef HWRENDER
{IT_NOTHING|IT_SPACE, NULL, NULL,
NULL, {NULL}, 0, 0},

View file

@ -666,7 +666,7 @@ void R_DrawPlanes(void)
if (pl->ffloor != NULL || pl->polyobj != NULL)
continue;
R_DrawSinglePlane(&ds, pl, true);
R_DrawSinglePlane(&ds, pl, cv_parallelsoftware.value);
}
}
}

View file

@ -136,6 +136,7 @@ extern UINT8 *scr_borderpatch; // patch used to fill the view borders
extern consvar_t cv_scr_width, cv_scr_height, cv_scr_depth, cv_renderview, cv_renderer, cv_renderhitbox, cv_fullscreen;
extern consvar_t cv_vhseffect, cv_shittyscreen;
extern consvar_t cv_parallelsoftware;
// wait for page flipping to end or not
extern consvar_t cv_vidwait;