Add support for stenciled swapchains in EGL

Support for GLX, WGL and WebGL is still missing.

partially fixes #7232
This commit is contained in:
Mathias Agopian
2023-10-19 14:12:48 -07:00
committed by Mathias Agopian
parent 8303d6b28e
commit f75f7039f4

View File

@@ -174,7 +174,9 @@ Driver* PlatformEGL::createDriver(void* sharedContext, const Platform::DriverCon
// find a config we can use if we don't have "EGL_KHR_no_config_context" and that we can use
// for the dummy pbuffer surface.
mEGLConfig = findSwapChainConfig(SWAP_CHAIN_CONFIG_TRANSPARENT);
mEGLConfig = findSwapChainConfig(
SWAP_CHAIN_CONFIG_TRANSPARENT |
SWAP_CHAIN_HAS_STENCIL_BUFFER );
if (UTILS_UNLIKELY(mEGLConfig == EGL_NO_CONFIG_KHR)) {
goto error; // error already logged
}
@@ -344,6 +346,7 @@ EGLConfig PlatformEGL::findSwapChainConfig(uint64_t flags) const {
{ EGL_BLUE_SIZE, 8 },
{ EGL_ALPHA_SIZE, (flags & SWAP_CHAIN_CONFIG_TRANSPARENT) ? 8 : 0 },
{ EGL_DEPTH_SIZE, 24 },
{ EGL_STENCIL_SIZE, (flags & SWAP_CHAIN_HAS_STENCIL_BUFFER) ? 8 : 0 }
};