dumbass workaround for issues on xwayland with nvidia
this will run automatically when it detects an nvidia gpu even with gr_framebuffer disabled lol we have safeguards everywhere so shouldnt be an issue
This commit is contained in:
1 parent
cded0af061
commit
0f94a26dc6
4 files changed
+53
-4
No files matched your search
@@ -775,8 +775,8 @@ static boolean GLFramebuffer_IsFuncAvailible(void)
|
||||
if (majorGL < 3)
|
||||
return false;
|
||||
|
||||
return((isExtAvailable("GL_ARB_framebuffer_no_attachments",gl_extensions)) &&
|
||||
(isExtAvailable("GL_ARB_framebuffer_object",gl_extensions)) &&
|
||||
return((isExtAvailable("GL_ARB_framebuffer_no_attachments",gl_extensions)) &&
|
||||
(isExtAvailable("GL_ARB_framebuffer_object",gl_extensions)) &&
|
||||
(isExtAvailable("GL_ARB_framebuffer_sRGB",gl_extensions)));
|
||||
|
||||
return false;
|
||||
|
||||
@@ -140,6 +140,10 @@ UINT32 I_GetRefreshRate(void);
|
||||
boolean I_UseNativeKeyboard(void);
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
#if defined (__unix__)
|
||||
extern boolean xwaylandcrap;
|
||||
#endif
|
||||
|
||||
void RefreshOGLSDLSurface(void);
|
||||
void I_DownSample(void);
|
||||
extern boolean downsample;
|
||||
|
||||
@@ -217,6 +217,10 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen);
|
||||
static void Impl_SetWindowIcon(void);
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
#if defined (__unix__)
|
||||
static void I_FixXwaylandNvidia(void);
|
||||
boolean xwaylandcrap = false;
|
||||
#endif
|
||||
boolean downsample = false;
|
||||
void RefreshOGLSDLSurface(void)
|
||||
{
|
||||
@@ -278,6 +282,9 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen, SDL_bool
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
#ifdef USE_FBO_OGL
|
||||
#if defined (__unix__)
|
||||
I_FixXwaylandNvidia();
|
||||
#endif
|
||||
I_DownSample();
|
||||
#endif
|
||||
OglSdlSurface(vid.width, vid.height);
|
||||
@@ -777,6 +784,23 @@ void I_DownSample(void)
|
||||
else
|
||||
downsample = false; // its not so no need to do crap
|
||||
}
|
||||
|
||||
#if defined (__unix__)
|
||||
static void I_FixXwaylandNvidia(void) //dumbass crap, fix ur shit nvidia
|
||||
{
|
||||
if (!supportFBO)
|
||||
{
|
||||
xwaylandcrap = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// enable fbo resize shit, update the ogl surface and turn crap back off lol
|
||||
xwaylandcrap = true;
|
||||
RefreshOGLSDLSurface();
|
||||
xwaylandcrap = false;
|
||||
RefreshOGLSDLSurface();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void Impl_HandleWindowEvent(SDL_WindowEvent evt)
|
||||
|
||||
+23
-2
@@ -68,6 +68,12 @@ PFNglGetIntegerv pglGetIntegerv;
|
||||
PFNglGetString pglGetString;
|
||||
#endif
|
||||
|
||||
#if defined (__unix__)
|
||||
#ifdef USE_FBO_OGL
|
||||
static boolean isnvidiagpu = false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/** \brief SDL video display surface
|
||||
*/
|
||||
INT32 oglflags = 0;
|
||||
@@ -166,6 +172,13 @@ boolean OglSdlSurface(INT32 w, INT32 h)
|
||||
maximumAnisotropy = 1;
|
||||
|
||||
granisotropicmode_cons_t[1].value = maximumAnisotropy;
|
||||
|
||||
#if defined (__unix__)
|
||||
#ifdef USE_FBO_OGL
|
||||
if (strstr((const char*)gl_renderer, "NVIDIA"))
|
||||
isnvidiagpu = true;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
first_init = true;
|
||||
|
||||
@@ -191,7 +204,11 @@ boolean OglSdlSurface(INT32 w, INT32 h)
|
||||
RenderToFramebuffer = FrameBufferEnabled;
|
||||
GLFramebuffer_Disable();
|
||||
|
||||
if (RenderToFramebuffer && downsample)
|
||||
if ((RenderToFramebuffer && downsample)
|
||||
#if defined (__unix__)
|
||||
|| (isnvidiagpu && xwaylandcrap)
|
||||
#endif
|
||||
)
|
||||
GLFramebuffer_Enable();
|
||||
#endif
|
||||
|
||||
@@ -229,7 +246,11 @@ void OglSdlFinishUpdate(boolean waitvbl)
|
||||
HWR_DrawScreenFinalTexture(sdlw, sdlh);
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
if (RenderToFramebuffer && downsample)
|
||||
if ((RenderToFramebuffer && downsample)
|
||||
#if defined (__unix__)
|
||||
|| (isnvidiagpu && xwaylandcrap)
|
||||
#endif
|
||||
)
|
||||
GLFramebuffer_Enable();
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user