Skip to content
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

Vulkan renderer only draws in top quarter of screen #304

Open
ostrich opened this issue Nov 15, 2024 · 9 comments
Open

Vulkan renderer only draws in top quarter of screen #304

ostrich opened this issue Nov 15, 2024 · 9 comments

Comments

@ostrich
Copy link

ostrich commented Nov 15, 2024

I'm on Arch Linux using Nvidia Open drivers and Wayland. I'm using the quake3e-git package from the AUR.

Using the Vulkan renderer, the game only renders in the top quarter of my fullscreen window as shown. When I set r_fullscreen 0, the game still only renders in the top quarter of the window. cl_renderer opengl renders the entire fullscreen window as expected.

Perhaps relevant settings:

seta r_mode "-1"
seta r_customwidth "3840"
seta r_customheight "2160"
seta cl_renderer "vulkan"
seta r_fullscsreen "1"

Screenshot_20241115_161741

@ensiform
Copy link
Contributor

ensiform commented Nov 15, 2024

Seems like wayland is reporting wrong size to game due to scaling factor. Are you using xwayland or did you force to wayland with sdl video driver env? r_mode is not used by default in r_fullscreen 1, r_modeFullscreen is. Also if your desktop resolution is in fact 4k you should be able to use -2 and not specify the width/height cvars.

Note it works fine for 4k res for me under Manjaro Linux KDE. Albeit this is X11 and NOT wayland.

@ostrich
Copy link
Author

ostrich commented Nov 15, 2024

It is using Wayland. Still getting the same behavior with r_mode -2 and r_modeFullscreen -2.

----- Initializing Renderer ----
-------------------------------
----- R_Init -----
SDL using driver "wayland"
Initializing Vulkan display
...setting mode -2: 3072 1728
Using 24 color bits, 24 depth, 8 stencil display.

@ensiform
Copy link
Contributor

ensiform commented Nov 16, 2024

You should probably try to force it to use x11 with SDL_VIDEODRIVER=x11 env var and have xwayland translate it. Wayland support is at the mercy of whatever SDL2 can handle with whatever scaling is on your machine.

@ostrich
Copy link
Author

ostrich commented Nov 16, 2024

Vulkan does work correctly with SDL_VIDEODRIVER=x11. For what it's worth, I'm using KDE Plasma 6.2.3 at 125% scaling. Thanks for your help.

@ec-
Copy link
Owner

ec- commented Nov 24, 2024

Try to compile and run debug build and post \condump contents here

@ensiform
Copy link
Contributor

ensiform commented Nov 24, 2024

SDL_WINDOW_ALLOW_HIGHDPI presumably desired on wayland and macOS but even then not guaranteed. SDL_Vulkan_GetDrawableSize / SDL_GL_GetDrawableSize / SDL_GetWindowSize will have different behavior iirc.

Not really great wayland support with highdpi until SDL3 which has a lot of other downsides still that I can tell.

@ec-
Copy link
Owner

ec- commented Nov 24, 2024

SDL2 might not report correctly window dimensions for Vulkan in Wayland mode, I see no reliable ways to fix this on engine side

@ostrich
Copy link
Author

ostrich commented Nov 25, 2024

now SDL_VIDEODRIVER=x11 doesn't seem to work, which did before

@ensiform
Copy link
Contributor

What else did you change on the system?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants