-
Notifications
You must be signed in to change notification settings - Fork 258
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
Add Video Extension functions to support Vulkan #1022
Conversation
c05b4ee
to
875c88b
Compare
Yes, this is very similar to what I currently do in simple64, but I would say this:
|
The difference between
Because the video plugin doesn't know how big the list will be (it doesn't know the number of extensions), it can't initialize the array/list. It makes sense to pass a pointer, and then have the frontend (vidext) create and populate the list, passing back the length of the list in the |
The function is used differently than what you have in simple64, VkSurfaceKHR surface;
VkInstance instance;
VidExt_VK_GetSurface((uint64_t*)&surface, (uint64_t)instance); Instead of the code you have now: VkInstance instance;
VkSurfaceKHR surface = (VkSurfaceKHR)VidExt_GetVkSurface((void*)instance);
That makes sense, I'll change it. |
875c88b
to
6aee6af
Compare
Oh, I see, I mean to me it makes sense that the vksurface is the return value for the function, since it is created by the function, whereas the instance is an input for the function. But either way would work. But regardless, they should both be |
6aee6af
to
c80c80b
Compare
makes sense, changed it to |
LGTM |
c80c80b
to
e2f62e8
Compare
LGTM too. Would wait for @richard42 to give final inputs. |
If I may suggest...I would just rename |
I think it makes sense, it's not Vulkan specific, it allows you to choose the rendering mode (currently OpenGL or Vulkan, but it leaves it open for others in the future) It could maybe be something like |
Ah right, it should be better this way. |
37fe043
to
cf7781c
Compare
I've renamed |
You've gone above and beyond @Rosalie241 , good work! |
bbaf548
to
af287ee
Compare
af287ee
to
761b344
Compare
The Vulkan API can be used by video plugins and front-end, but we don't currently ship any such components. Added upstream in mupen64plus/mupen64plus-core#1022
This introduces the following video extension functions:
VidExt_InitWithRenderMode()
Which allows a front-end to initialize based on a specific render mode (Vulkan or OpenGL),
I left the original
VidExt_Init()
alone for backwards compatability, and a front-end can easily just call their ownVidExt_Init()
when the render mode is OpenGL.VidExt_VK_GetSurface()
Which allows a plugin to retrieve a vulkan surface to render to, note that it's a pointer to
void*
, that's due to the fact thatVkSurfaceKHR
is a opaque handle, but since including the vulkan headers seems wasteful, It makes sense to use avoid*
instead, the plugin and front-end can do the casting themselves.VidExt_VK_GetInstanceExtensions()
Which allows a plugin to retrieve the supported vulkan extensions, note that it's upto the vidext implementation to create a
const char*
array and pass that back with it's size.Ping @loganmc10 because these changes are currently untested, but I feel like this is enough for a front-end to support both OpenGL and Vulkan plugins.