What's the best way to share a texture/image between two context with out context sharing?

前端 未结 3 1991
鱼传尺愫
鱼传尺愫 2021-01-25 06:15

What I want to do is to get the render result from one context, and do some further rendering in another context which do not shared with the previous one.

The only meth

3条回答
  •  难免孤独
    2021-01-25 06:29

    I'm not aware of a way to share them correctly. The closest I could find for GLX is the GLX_NV_copy_image extension. In the introduction, it says:

    The WGL and GLX versions allow copying between images in different contexts, even if those contexts are in different sharelists or even on different physical devices.

    With this extension, you would use the glXCopyImageSubDataNV() function to copy from one context to the other. While this does not allow sharing, it might still be much faster than copying the data yourself.

    As you can already tell from the name, this is a vendor specific extension. I don't know how widely supported it is, but you certainly shouldn't count on it being present on all systems.

    Other window system bindings have mechanisms for sharing images even between processes. E.g. with EGL, which is used with OpenGL ES, EGLImage can be used for this purpose. But from browsing through the GLX spec and list of extensions, I couldn't spot anything similar there.

提交回复
热议问题