You are not logged in.

#1 2021-01-07 19:30:44

michelesr
Member
Registered: 2016-02-04
Posts: 47

How to run PPSSPP with native Wayland and Vulkan driver?

SDL2 applications can now be run by setting the SDL_VIDEODRIVER=wayland enviroment variable. However, this seems to be a problem for the PPSSPP emulator running with Vulkan.

The ppsspp doesn't came with Wayland/Vulkan support, but the buiild can be configured to enable Wayland/Vulkan support by setting -DUSE_WAYLAND_WSI=ON. I tried that but all I end up with is a blank/nil window in Sway WM (no window at all in Weston).

I've opened an issue upstream to get support from the maintainers (https://github.com/hrydgard/ppsspp/issues/13845), but I thought I would try the Arch Linux forum too as someone might have managed to make it run properly on Arch. Native Wayland support seems to work with the OpenGL backend as long as you install glew-wayland instead of glew.

EDIT: forgot to mention that the emulator runs properly with Vulkan when SDL_VIDEODRIVER=x11 (by using XWayland).

Last edited by michelesr (2021-01-07 19:32:48)

Offline

#2 2021-01-07 20:29:17

progandy
Member
Registered: 2012-05-17
Posts: 4,039

Re: How to run PPSSPP with native Wayland and Vulkan driver?

Does a simple SDL2/vulkan example like this work? https://github.com/davll/sdl-vkcube

You need the following patch to compile it: (adapted from https://github.com/KhronosGroup/Vulkan- … e627e5175)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15800b2..71ce066 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,7 +39,7 @@ add_executable(vkcube
                 cube.vert.inc
                 cube.frag.inc)
 
-target_link_libraries(vkcube Vulkan::Vulkan SDL2::SDL2)
+target_link_libraries(vkcube Vulkan::Vulkan SDL2::SDL2 m)
 
 include(CheckLibraryExists)
 CHECK_LIBRARY_EXISTS("rt" clock_gettime "" NEED_RT)
diff --git a/cube.c b/cube.c
index 4abef33..65f8de7 100644
--- a/cube.c
+++ b/cube.c
@@ -1933,6 +1933,7 @@ static void demo_prepare_fs(struct demo *demo) {
 }
 
 static void demo_prepare_pipeline(struct demo *demo) {
+ #define NUM_DYNAMIC_STATES 2 /*Viewport + Scissor*/ 
     VkGraphicsPipelineCreateInfo pipeline;
     VkPipelineCacheCreateInfo pipelineCache;
     VkPipelineVertexInputStateCreateInfo vi;
@@ -1942,7 +1943,7 @@ static void demo_prepare_pipeline(struct demo *demo) {
     VkPipelineDepthStencilStateCreateInfo ds;
     VkPipelineViewportStateCreateInfo vp;
     VkPipelineMultisampleStateCreateInfo ms;
-    VkDynamicState dynamicStateEnables[VK_DYNAMIC_STATE_RANGE_SIZE];
+    VkDynamicState dynamicStateEnables[NUM_DYNAMIC_STATES];
     VkPipelineDynamicStateCreateInfo dynamicState;
     VkResult U_ASSERT_ONLY err;
 

Last edited by progandy (2021-01-07 20:30:15)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2021-01-07 21:01:25

michelesr
Member
Registered: 2016-02-04
Posts: 47

Re: How to run PPSSPP with native Wayland and Vulkan driver?

Does a simple SDL2/vulkan example like this work? https://github.com/davll/sdl-vkcube

Yes, it works, but the cursor is bigger than normal on Wayland (while it's fine in XWayland).

Offline

Board footer

Powered by FluxBB