[WIP] Add complete support for Vulkan on the TTY (using the KHR_DISPLAY extension)#14758
[WIP] Add complete support for Vulkan on the TTY (using the KHR_DISPLAY extension)#14758vanfanel wants to merge 7 commits intohrydgard:masterfrom
Conversation
Common/GPU/Vulkan/VulkanContext.cpp
Outdated
| image_size.width = pixel_xres; | ||
| image_size.height = pixel_yres; | ||
|
|
||
| display.sType = VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR; |
There was a problem hiding this comment.
This shouldn't be needed as it was part of the initializer.
-[Unknown]
There was a problem hiding this comment.
Removed redundant initialization.
| display.displayMode = display_mode; | ||
| display.imageExtent = image_size; | ||
| display.transform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; | ||
| display.alphaMode = alpha_mode; |
There was a problem hiding this comment.
It looks like alpha_mode is never initialized? We're fine with VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR (ideally) or VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR for the backbuffer.
-[Unknown]
There was a problem hiding this comment.
alpha_mode is initialized here:
As you can see, it's being initialized to VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR
|
This is related to this |
|
Hm, this one somehow got forgotten, I'm sorry about that. But yes I believe #16921 takes care of it? |
Hey! I am using MESA's V3D Vulkan implementation (in other words, Raspberry Pi 4 Vulkan graphics). I will this when I have time (I had time when I started this, but sadly I don't have much time now... and I use PPSSPP RetroArch core now, which has proper video synchronization anyway) |
Hi,
There's partial support for KHR_DISPLAY, but it only works for libretro builds.
It should work for non-libretro builds, too.
This adds the specific code to create the Vulkan surface in this case, and inhibits the SDL_Window creation (you can't have a TTY SDL_Window, which runs on the KMSDRM backend, and Vulkan graphics at the same time, because SDL2 KMSDRM backend and Vulkan KHR_DISPLAY use the same resources, so Vulkan reports zero displays and planes if an SDL_Window has been created).
This does not work yet:
vkQueuePresentKHR()returnsVK_ERROR_SURFACE_LOST_KHRand I have no idea on why.So this needs to be revised by a more Vulkan knowledgeable coder.