remove the extra screentex and apply palshader directly to finaltex

theres basically barely any difference, even in the fades theres very little, and it just cost so freaking much performance

however, ill keep the revamped screentex setup as this it allows us to keep the better fadescreen background for menus
This commit is contained in:
Alug committed 2024-01-18 17:03:16 +01:00
1 parent e77a4d4690
commit 00dbd08641
8 files changed
+11 -31

No files matched your search

+1 -2
View File
@@ -294,8 +294,7 @@ enum hwdscreentexture
HWD_SCREENTEXTURE_WIPE_START, // source image for the wipe/fade effect
HWD_SCREENTEXTURE_WIPE_END, // destination image for the wipe/fade effect
HWD_SCREENTEXTURE_GENERIC1, // underwater/heat effect, intermission background
HWD_SCREENTEXTURE_GENERIC2, // palette-based colormap fade, screen before palette rendering's postprocessing
HWD_SCREENTEXTURE_GENERIC3, // screen after palette rendering's postprocessing
HWD_SCREENTEXTURE_GENERIC2, // palette-based colormap fade, final screen texture
NUMSCREENTEXTURES, // (generic3 is unused if palette rendering is disabled)
};
typedef enum hwdscreentexture hwdscreentexture_t;
+3 -5
View File
@@ -563,7 +563,7 @@ void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength)
if (color & 0xFF00) // Do COLORMAP fade.
{
if (HWR_ShouldUsePaletteRendering() && !cv_groldpal.value)
if (HWR_ShouldUsePaletteRendering() && cv_grscreentextures.value)
{
const hwdscreentexture_t scr_tex = HWD_SCREENTEXTURE_GENERIC2;
@@ -1178,7 +1178,6 @@ static inline boolean saveTGA(const char *file_name, void *buffer,
UINT8 *HWR_GetScreenshot(void)
{
static UINT8 *buf = NULL;
int tex = ((HWR_ShouldUsePaletteRendering() && !cv_groldpal.value) ? HWD_SCREENTEXTURE_GENERIC3 : HWD_SCREENTEXTURE_GENERIC2);
buf = realloc(buf, vid.width * vid.height * 3);
@@ -1186,7 +1185,7 @@ UINT8 *HWR_GetScreenshot(void)
return NULL;
// returns 24bit 888 RGB
HWD.pfnReadScreenTexture(tex, (void *)buf);
HWD.pfnReadScreenTexture(HWD_SCREENTEXTURE_GENERIC2, (void *)buf);
return buf;
}
@@ -1194,7 +1193,6 @@ boolean HWR_Screenshot(const char *pathname)
{
boolean ret;
UINT8 *buf = malloc(vid.width * vid.height * 3 * sizeof (*buf));
int tex = ((HWR_ShouldUsePaletteRendering() && !cv_groldpal.value) ? HWD_SCREENTEXTURE_GENERIC3 : HWD_SCREENTEXTURE_GENERIC2);
if (!buf)
{
@@ -1203,7 +1201,7 @@ boolean HWR_Screenshot(const char *pathname)
}
// returns 24bit 888 RGB
HWD.pfnReadScreenTexture(tex, (void *)buf);
HWD.pfnReadScreenTexture(HWD_SCREENTEXTURE_GENERIC2, (void *)buf);
#ifdef USE_PNG
ret = M_SavePNG(pathname, buf, vid.width, vid.height, NULL);
+3 -7
View File
@@ -124,7 +124,7 @@ consvar_t cv_secbright = {"secbright", "0", CV_SAVE, secbright_cons_t,
consvar_t cv_grfovchange = {"gr_fovchange", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// values for the far clipping plane
static float clipping_distances[] = {1024.0f, 2048.0f, 4096.0f, 6144.0f, 8192.0f, 12288.0f, 16384.0f};
// values for bsp culling
@@ -152,7 +152,6 @@ static CV_PossibleValue_t glpalettedepth_cons_t[] = {{16, "16 bits"}, {24, "24 b
consvar_t cv_grpalettedepth = {"gr_palettedepth", "16 bits", CV_SAVE|CV_CALL, glpalettedepth_cons_t, CV_grpalettedepth_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grflashpal = {"gr_flashpal", "On", CV_CALL|CV_SAVE, CV_OnOff, CV_grshaders_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_groldpal = {"gr_oldpal", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grmdls = {"gr_mdls", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grfallbackplayermodel = {"gr_fallbackplayermodel", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -6426,7 +6425,6 @@ void HWR_AddCommands(void)
CV_RegisterVar(&cv_grpaletterendering);
CV_RegisterVar(&cv_grpalettedepth);
CV_RegisterVar(&cv_grflashpal);
CV_RegisterVar(&cv_groldpal);
}
// --------------------------------------------------------------------------
@@ -6669,14 +6667,12 @@ void HWR_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT
void HWR_MakeScreenFinalTexture(void)
{
int tex = ((HWR_ShouldUsePaletteRendering() && !cv_groldpal.value) ? HWD_SCREENTEXTURE_GENERIC3 : HWD_SCREENTEXTURE_GENERIC2);
HWD.pfnMakeScreenTexture(tex);
HWD.pfnMakeScreenTexture(HWD_SCREENTEXTURE_GENERIC2);
}
void HWR_DrawScreenFinalTexture(int width, int height)
{
int tex = ((HWR_ShouldUsePaletteRendering() && !cv_groldpal.value) ? HWD_SCREENTEXTURE_GENERIC3 : HWD_SCREENTEXTURE_GENERIC2);
HWD.pfnDrawScreenFinalTexture(tex, width, height);
HWD.pfnDrawScreenFinalTexture(HWD_SCREENTEXTURE_GENERIC2, width, height);
}
// jimita 18032019
-1
View File
@@ -195,7 +195,6 @@ extern consvar_t cv_grusecustomshaders;
extern consvar_t cv_grpaletterendering;
extern consvar_t cv_grpalettedepth;
extern consvar_t cv_grflashpal;
extern consvar_t cv_groldpal;
extern consvar_t cv_grscreentextures;
extern consvar_t cv_grportals;
extern consvar_t cv_nostencil;
+2 -2
View File
@@ -3708,7 +3708,7 @@ EXPORT void HWRAPI(DrawScreenFinalTexture)(int tex, int width, int height)
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
if ((HWR_ShouldUsePaletteRendering()) && cv_groldpal.value)
if (HWR_ShouldUsePaletteRendering())
pglUseProgram(gl_shaderprograms[8].program); // palette postprocess shader
pglColor4ubv(white);
@@ -3718,7 +3718,7 @@ EXPORT void HWRAPI(DrawScreenFinalTexture)(int tex, int width, int height)
pglDrawArrays(GL_TRIANGLE_FAN, 0, 4);
if ((HWR_ShouldUsePaletteRendering()) && cv_groldpal.value)
if (HWR_ShouldUsePaletteRendering())
pglUseProgram(0);
tex_downloaded = screenTextures[tex];
+1 -3
View File
@@ -1495,7 +1495,6 @@ static menuitem_t OP_ExpOptionsMenu[] =
{IT_STRING | IT_CVAR, NULL, "Screen Textures", &cv_grscreentextures, 75},
{IT_STRING | IT_CVAR, NULL, "Palette Depth", &cv_grpalettedepth, 85},
{IT_STRING | IT_CVAR, NULL, "Old Palshader Screentexture", &cv_groldpal, 95},
{IT_STRING | IT_CVAR, NULL, "Splitwall/Slope texture fix", &cv_splitwallfix, 105},
{IT_STRING | IT_CVAR, NULL, "Slope midtexture peg fix", &cv_slopepegfix, 115},
@@ -1514,8 +1513,7 @@ static const char* OP_ExpTooltips[] =
"Hides Sprites which are not visible\npotentially resulting in a performance boost.",
#ifdef HWRENDER
"Should the game do Screen Textures? Provides a good boost to frames\nat the cost of some visual effects not working when disabled.",
"Fixes issues that resulted in Textures sticking from the\nground sometimes.\nThis may be CPU heavy and result in worse performance in some cases.",
"Changes back to old Palette renderer screentexture behaviour\nthis makes performance better and keeps the old visuals\nat the cost of accuracy.",
"Change the depth of the Palette in Palette rendering mod\n 16 bits is like software looks ingame\nwhile 24 bits is how software looks in screenshots.",
"Fixes issues that resulted in Textures sticking from the ground sometimes.\n This may be CPU heavy and result in worse performance in some cases.",
"Fixes issues that resulted in Textures not being properly skewed\n example: Fences on slopes that didnt show proper.\n This may be CPU heavy and result in worse performance in some cases.",
"Fixes issues that resulted in Textures on Floor over Floors\nZFighting heavily.",
-8
View File
@@ -1483,14 +1483,6 @@ void I_FinishUpdate(void)
#ifdef HWRENDER
else if (rendermode == render_opengl)
{
// Final postprocess step of palette rendering, after everything else has been drawn.
if (HWR_ShouldUsePaletteRendering() && !cv_groldpal.value)
{
HWD.pfnMakeScreenTexture(HWD_SCREENTEXTURE_GENERIC2);
HWD.pfnSetShader(8);
HWD.pfnDrawScreenTexture(HWD_SCREENTEXTURE_GENERIC2, NULL, 0);
HWD.pfnUnSetShader();
}
OglSdlFinishUpdate(cv_vidwait.value);
}
#endif
+1 -3
View File
@@ -233,9 +233,7 @@ void OglSdlFinishUpdate(boolean waitvbl)
// Sryder: We need to draw the final screen texture again into the other buffer in the original position so that
// effects that want to take the old screen can do so after this
// Generic2 has the screen image without palette rendering brightness adjustments.
// Using that here will prevent brightness adjustments being applied twice.
DrawScreenTexture(HWD_SCREENTEXTURE_GENERIC2, NULL, 0);
HWR_DrawScreenFinalTexture(realwidth, realheight);
}
EXPORT void HWRAPI(OglSdlSetPalette) (RGBA_t *palette)