dont draw final screen texture twice if you use native res

no need to
saves some performance
This commit is contained in:
Alug committed 2024-11-27 22:35:49 +01:00
1 parent 702dd09d3f
commit ea0babc5c0
3 files changed
+34 -1

No files matched your search

+2
View File
@@ -139,6 +139,8 @@ UINT32 I_GetRefreshRate(void);
boolean I_UseNativeKeyboard(void);
boolean I_CheckNativeRes(void);
#ifdef USE_FBO_OGL
#if defined (__unix__)
extern boolean xwaylandcrap;
+26 -1
View File
@@ -706,10 +706,35 @@ static INT32 SDLJoyAxis(const Sint16 axis, evtype_t which)
return raxis;
}
boolean I_CheckNativeRes(void)
{
static int oldwidth = 0, oldheight = 0;
static boolean resstate = false;
int currentDisplayIndex = 0;
SDL_DisplayMode curmode;
if (oldwidth == vid.width && oldheight == vid.height)
{
return resstate;
}
currentDisplayIndex = SDL_GetWindowDisplayIndex(window);
if (SDL_GetCurrentDisplayMode(currentDisplayIndex, &curmode) != 0)
{
return resstate;
}
resstate = ((vid.width == curmode.w) && (vid.height == curmode.h));
oldwidth = vid.width;
oldheight = vid.height;
return resstate;
}
#ifdef USE_FBO_OGL
void I_DownSample(void)
{
if (!cv_glframebuffer.value || !supportFBO) //no sense to do this crap if we cant benefit from it
if (!cv_glframebuffer.value || !supportFBO || I_CheckNativeRes()) //no sense to do this crap if we cant benefit from it
{
downsample = false;
return;
+6
View File
@@ -300,6 +300,12 @@ 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
if ((!I_CheckNativeRes()) // well we dont need it on native res it seems
#ifdef USE_FBO_OGL
&& (!UseScreenFBO())
#endif
)
HWR_DrawScreenFinalTexture(realwidth, realheight);
//HWR_DrawScreenFinalTexture(realwidth, realheight);
//GL_DrawScreenFinalTexture(HWD_SCREENTEXTURE_GENERIC2, realwidth, realheight);