-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wayland: regression with imgui-rebased ( https://github.com/dhewm/dhewm3/pull/576 ) #587
Comments
the same assertion fails each time here is the bt
|
Does that also happen in the current master branch? Because imgui-rebased as been merged |
yes sorry, I used the master branch. |
Ok - can you tell me what imgui menu -> video options says about "Current Resolution" and "Display Size", both in windowed mode and fullscreen mode (if needed because using imgui menu crashes on apply, configure that through console and use a full Oh right, and if that also doesn't work because the assertion triggers just by opening the video menu, comment out the line with the assertion (neo/sys/glimp.cpp:728) |
seems to work fine w/o the assertion. windowed mode: fullscreen mode: SDL_VIDEODRIVER=x11 fullscreen mode: with SDL_VIDEDRIVER=wayland the same with vkquake or ironwail. with SDL_VIDEODRIVER=x11 fullscreen uses the real resolution 2560x1440 |
does it say anything about "Physical" (it does when detecting display scaling) in the menu, next to Current Resolution and Display Size? |
no. in fullscreen mode the desktop size always equals the configured game resolution. ( x11 driver ) update: probably can´t detect any scaling, because the desktop is not scaled ( 100 % ) |
If I understand the problem right this behavior is kind of expected: Under Wayland the fullscreen handling is compositor dependent. In my experience tho common compositors (kwin, mutter, wlroots) don't support implement switching initiated by clients. When a client requests fullscreen mode, the client is a) put in exclusive fullscreen mode when it's drawable size matches the current resolution of the given display or b) scaled up / down if it's drawable size is lower / higher than the resolution of the given display. Fractional scaling and scaling awareness of the client shouldn't matter in exclusive fullscreen, the common compositors communicate a scaled display mode, but an unscaled drawable size. That might break assumptions made by the client, though. |
Does it help if at the end of GLimp_SetScreenParms(), around here: https://github.com/dhewm/dhewm3/blob/master/neo/sys/glimp.cpp#L685, maybe after that |
no change. all what was needed was commenting out the assert at line 728 |
ok, I'll have to debug this on wayland
that's no solution - if the values in glConfig aren't correct (consistent with the actual sizes), other code will behave wrong (for example mouse cursor speed, possibly even rendering itself) |
assert( ret.width == glConfig.winWidth && ret.height == glConfig.winHeight ); in GLimp_GetCurState() triggered, because SDL_GetWindowSize(), which was used to set glConfig.winWidth/Height in GLimp_UpdateWindowSize(), returned different values than SDL_GetWindowDisplayMode(). Now use SDL_GetWindowDisplayMode() in GLimp_UpdateWindowSize() so it's at least consistent. However it seems like SDL_GetWindowSize() returns the correct values (IN THAT CASE), because with this change the mouse cursor doesn't work that well (in the specific case described above). In the end this is an SDL or Wayland bug or something, and I can only recommend not using "real" fullscreen mode with Wayland, as it's fake anyway (Wayland doesn't allow switching the display resolution, so you get a magically scaled borderless fullscreen window at best)
I pushed a fix for this to master. Overall that case is still kinda broken (no crash anymore, but mousecursor behaves weird), and that's a bug in SDL or Wayland. I think the main underlying issue is that Wayland does not support real fullscreen mode. So all you get is fugly hacks: In the native Wayland case ( In the XWayland case however it apparently creates a borderless fullscreen window at the desktop resolution (2560x1440 in your case, not the one you requested!). For some reason however, one SDL function ( Due to dhewm3 using the wrong size (at least consistently now..), the mouse input can behave weird in this specific case (XWayland + "real" fullscreen at lower resolution). Extra unfortunate: think in the past I've seen |
So the mouse cursor could behave strangely in the GUI /PDA ? But mouse movement in game should not be affected? Have to reboot to fedora again to test. The scaling with native Wayland and use of real desktop resolution with Xwayland is consistent with other apps I tried so far. |
Yeah, I think so. I specifically noticed that the cursor position in ImGui isn't consistent with the one in the main menu anymore. I recommend using only "fullscreen desktop" mode with Wayland, because real fullscreen isn't supported anyway. |
My motivation for this was the advantage of having a configured lower resolution for windowed mode and a full desktop resolution at one click or keyboard shortcut like alt/enter. Otherwise aliases are needed.
is something like this available in doom3? |
Wouldn't SDL_GL_GetDrawableSize() be a more suitable call? It should report the real dimensions of the drawable.
|
No, because the mouse coordinates don't use the drawable size but the window size (when they're different, like in HighDPI/desktop scaling mode).
You can also use aliases and all that, but the easiest way is to enable fullscreen desktop (r_fullscreenDesktop) mode. |
ok, there are other more serious issues if Xwayland is involved. all viewports (?) for windows have a wrong angle, show the wrong parts of the room. Screenshots are also incomplete and sometimes have other garbage. is there an option to disable the vid_restart partial codepath? |
uhh.. wtf.. didn't have that issue is this on master or kickstart-my-hertz? |
both! those are screenshots created with the engine. only windows and the ship engines look strange. |
Does it only look broken in screenshots or also on the actual screen? So far I really can't reproduce this, even with Wayland + Gnome |
everythinig looks fine in game but the windows and the engine exhausts of the ship's engines. what distribution? This is on upto date fedora 40 with the new NFB nvidia branch 555.58.02 |
I tested with latest Arch Linux (live image with Gnome from http://dl.gnutux.fr/archuseriso/img/, but updated that while running and additionally installed gnome-control-center) on a laptop with AMD iGPU (Ryzen 5 7640U). I just had a maybe similar issue: When changing the resolution (or toggling fullscreen) after taking a screenshot, the window remained black or invisible. |
ignore screenshots for a moment (it did not help btw.) here is a short video . Xwayland 24.1 |
I don't really see much in the video (at least no details in the reflections), maybe due to the low resolution. I tested with the space ship at the beginning of the game and didn't see any graphical bugs there. I'll test again with the Infirmary Could also be a graphics driver bug, of course |
download the video |
the 2nd screenshot above shows is very good. look at the window area. You should see the operator who initiates the scan. But we see the ceiling or parts of it instead driver bug: of course, have avoided the short lived NFB branch most of the time. |
Ok, with the downloaded video I can see that it looks wrong. Can't reproduce it though. Here it's the same XWayland and mutter versions, but SDL 2.30.4 (and of course no nvidia driver but the open source AMD driver) |
disables partial vid_restarts, hopefully works around issues like dhewm#587 (comment) Note that resizing the window by dragging it does *not* call vid_restart at all, so if you're having issues that are fixed by a full vid_restart you should also set `r_windowResizable 0`
Can't reproduce it with real X11 and nvidia driver 535.183 either. However, I just added a CVar |
enabled window resizing only for the ideo :) quck update: This looks indeed like a driver issue. The NFB driver showed better results with the 144Hz branch. It's only this window rendering after changing the dimentions of the game window. This will be fixed eventually by nvidia. This issue is tiggered by resizing the game window / changing game resolution w/o a hard vid_restart on wayland with Xwayland server. Native wayland is fine! |
So do you think we can consider this bug resolved (from dhewm3's point of view, I can't do anything about nvidias driver) by setting |
Yes, I think so. |
Great! |
disables partial vid_restarts, hopefully works around issues like #587 (comment) Note that resizing the window by dragging it does *not* call vid_restart at all, so if you're having issues that are fixed by a full vid_restart you should also set `r_windowResizable 0`
disables partial vid_restarts, hopefully works around issues like dhewm/dhewm3#587 (comment) Note that resizing the window by dragging it does *not* call vid_restart at all, so if you're having issues that are fixed by a full vid_restart you should also set `r_windowResizable 0`
disables partial vid_restarts, hopefully works around issues like dhewm/dhewm3#587 (comment) Note that resizing the window by dragging it does *not* call vid_restart at all, so if you're having issues that are fixed by a full vid_restart you should also set `r_windowResizable 0`
found easy procedure to crash dhewm3 on linux with wayland ( didn´t test with x11)
wayland/gnome
desktop resolution 2560x1440@144z (nvidia driver 555.58.02 )
SDL_VIDEODRIVER=x11 // no problem with SDL_VIDEODRIVER=wayland
with X11 the resolution used by SDL changes to desktop resolution
works with dhewm 1.5.3
several ways to reproduce
in main screen
alt/enter to fullscreen
alt/enter to window -> crash
in main screen
alt/enter to fullscreen
open imgui
select video tab -> crash
in main screen
open imgui/video
change from Windowed to Fullscreen
apply -> crash
bt is not very useful, need to get libbacktrace and recompile
dhewm 1.5.3 switches seamlessly to full screen 2560x1440 and back to the configured resolution in windowed mode.
The text was updated successfully, but these errors were encountered: