Skip to main content

import_gl_framebuffer_vulkan

Function import_gl_framebuffer_vulkan 

Source
pub fn import_gl_framebuffer_vulkan(
    gl: &Context,
    gl_extension_loader: &dyn Fn(&str) -> *const c_void,
    source_fbo: u32,
    size: PhysicalSize<u32>,
    host: &HostWgpuContext,
) -> Result<Texture, InteropError>
Expand description

Import a GL framebuffer into a wgpu::Texture via Vulkan external memory.

ยงArguments

  • gl - A glow GL context for texture and framebuffer operations
  • gl_extension_loader - Function to load GL extension entry points (e.g. GL_EXT_memory_object_fd). Typically wraps eglGetProcAddress or equivalent.
  • source_fbo - The GL framebuffer object to read from. Pass 0 for the default framebuffer.
  • size - Dimensions of the framebuffer content to import.
  • host - The host wgpu context (device + queue) that will own the resulting texture.

The returned texture is Rgba8Unorm with top-left origin (Y-flipped during blit).