This proposal regards layering OpenGL over Vulkan, and addresses a discrepancy where EGL is able to respond to certain queries before a surface is created, while Vulkan requires a surface for corresponding queries.
An application using EGL can query the list of supported
EGLConfigs, based on
which it would create an
Additionally, based on the availability of extensions, it can provide a
color space to
eglCreateWindowSurface at the same time.
In Vulkan, the format and color space information are retrievable from the
When layering OpenGL over Vulkan, there needs to be a way to query this
information before the surface is created.
Similarly, the OpenGL implementation layer needs to know:
The supported present modes by the platform to be able to correctly expose the
Whether protected surfaces are supported to be able to correctly expose the
On some implementations and platforms, the surface formats, color spaces, present modes and support for protected content are identical for every surface, and such queries could in fact be answered before a surface is created.
Currently, no cross-platform solution is known to exist to support layering OpenGL over Vulkan in this regard.
One solution is to modify the existing relevant queries to allow querying
This works on platforms where this information is truly global, which is
currently the case with Google’s Android and SwiftShader.
Trivial to implement and use
Works only on some platforms, and cannot be implemented on all platforms.
In VK_GOOGLE_surfaceless_query, the first solution is adopted primarily to accelerate producing working systems where OpenGL is layered on Vulkan.
With this extension, the
surface parameter can be
VK_NULL_HANDLE in the
VkSurfaceProtectedCapabilitiesKHRis chained to
pSurfaceCapabilities. In this case, only the protected information is populated, while
::surfaceCapabilitiesand any other chained structs will have undefined values.
In all the above situations, calling the function with any valid
parameter will produce identical results to calling it with