How to create single-buffer AndroidSurface in Vulkan?

Hello:

As we know, We can enable single-buffer attribute with egl like this:

 const EGLint windowAttribs[] = 
        {
            EGL_RENDER_BUFFER, EGL_SINGLE_BUFFER,
            EGL_PROTECTED_CONTENT_EXT, isProtectedContent,
            EGL_COLORSPACE, colorSpace,
            EGL_NONE

        };

eglCreateWindowSurface(display, config, gAppContext->modeContext->nativeWindow, windowAttribs);
eglMakeCurrent(display, surface, surface, context);
eglSurfaceAttrib(display, surface, EGL_RENDER_BUFFER, EGL_SINGLE_BUFFER);
eglSurfaceAttrib(display, surface, EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID, 1);

With the operation above, Traditional android triple or double buffer surface(ANatvieWindow) will be replaced by single buffer.

Also i want to achieve this goal in vulkan, But i can’t find any similar vulkan API like egl.
Could anybody give some advice, Thanks .

VK_PRESENT_MODE_IMMEDIATE_KHR, but Android generally does not support single-buffering.

So VK_PRESENT_MODE_MAILBOX_KHR.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.