Closed zack-huangzihan closed 1 year ago
GBM = https://www.reddit.com/r/linuxquestions/comments/ss4vhj/whats_the_gbm_api/ ?
I guess this hasn't been worked on yet, no. Feel free to help out.
Maybe my description is not correct enough. Can kms+vulkan be implemented?
As shown in the code above:
vulkan_->InitSurface(WINDOWSYSTEM_DISPLAY, nullptr, nullptr);
Common/GPU/Vulkan/VulkanContext.h:
enum WindowSystem {
#ifdef _WIN32
WINDOWSYSTEM_WIN32,
#endif
#ifdef __ANDROID__
WINDOWSYSTEM_ANDROID,
#endif
#ifdef VK_USE_PLATFORM_METAL_EXT
WINDOWSYSTEM_METAL_EXT,
#endif
#ifdef VK_USE_PLATFORM_XLIB_KHR
WINDOWSYSTEM_XLIB,
#endif
#ifdef VK_USE_PLATFORM_XCB_KHR
WINDOWSYSTEM_XCB,
#endif
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
WINDOWSYSTEM_WAYLAND,
#endif
#ifdef VK_USE_PLATFORM_DISPLAY_KHR
WINDOWSYSTEM_DISPLAY,
#endif
};
Is there any reason why only WINDOWSYSTEM_DISPLAY is not called? I only found similar apps here: libretro/LibretroVulkanContext.cpp
#ifdef _WIN32
vk->InitSurface(WINDOWSYSTEM_WIN32, nullptr, nullptr);
#elif defined(__ANDROID__)
vk->InitSurface(WINDOWSYSTEM_ANDROID, nullptr, nullptr);
#elif defined(VK_USE_PLATFORM_XLIB_KHR)
vk->InitSurface(WINDOWSYSTEM_XLIB, nullptr, nullptr);
#elif defined(VK_USE_PLATFORM_XCB_KHR)
vk->InitSurface(WINDOWSYSTEM_XCB, nullptr, nullptr);
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
vk->InitSurface(WINDOWSYSTEM_WAYLAND, nullptr, nullptr);
#elif defined(VK_USE_PLATFORM_DISPLAY_KHR)
vk->InitSurface(WINDOWSYSTEM_DISPLAY, nullptr, nullptr);
#endif
But it looks like and SDLVulkanGraphicsContext.cpp call is not the same?
I would like to see this support too. The libretro core works perfectly well on gbm/kms. However standalone ppsspp is supposed to be more efficient. I believe there is an earlier attempt to implement this here:
https://github.com/hrydgard/ppsspp/pull/14758
The initial comments suggest the work isn't complete yet.
hello, all @hrydgard @amverweij @vanfanel I'm so glad I realized this thing! The implementation here is referenced:https://github.com/vanfanel/ppsspp For the call to vulkan interface in kms on the arm linux system, I changed the changes inside to the form of dlopen,Let me explain how this code works:
First of all, in linux system, vulkan implementation is not open in the source code provided by gpu manufacturers, they use a hook called "vulkan loader", used to parse the ***.so of different manufacturers,It's usually "libvulkan.so",So I need to read it with dlopen needed to sign, and then in "SDL/SDLVulkanGraphicsContext CPP" add a WINDOWSYSTEM_DISPLAY implementation.
These implementations are in Common/GPU/Vulkan/VulkanContext.cpp
Both ui and game rendering worked well, so I submitted my code:
Thank you @zack-huangzihan for implementing this windowsystem initialization.
Can we consider this closed now?
ok
Game or games this happens in
games
What area of the game / PPSSPP
In the code: https://github.com/hrydgard/ppsspp/blob/ceb4186d0ffc26091bb3fc25a1e71bce15b8902d/SDL/SDLVulkanGraphicsContext.cpp
We can see that there is some support for the back end: WINDOWSYSTEM_WAYLAND WINDOWSYSTEM_XLIB WINDOWSYSTEM_XCB WINDOWSYSTEM_METAL_EXT and so on, Can gbm+vulkan render?
Here's how I changed it:
But it can't work. Do you have any advice for me?
What should happen
On a lot of embedded linux platforms, probably most of the way to use kms, hopefully can support
Logs
No response
Platform
Linux / BSD
Mobile phone model or graphics card
arm mali
PPSSPP version affected
latest
Last working version
No response
Graphics backend (3D API)
Vulkan
Checklist