wgpu-external-frame 0.4.0

Zero-copy import of externally produced GPU frames into wgpu textures: Linux DMA-BUF, Android AHardwareBuffer, macOS and iOS IOSurface, and Windows shared handles
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#version 450

// Covers the render target with one triangle, corners at clip coordinates
// (-1, -1), (3, -1) and (-1, 3), drawn with three vertices and no vertex
// buffer. `uv` runs from 0 to 1 across the target, (0, 0) at its top-left
// corner, so each fragment receives the normalized coordinate of its own
// texel centre.

layout(location = 0) out vec2 uv;

void main() {
    uv = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2);
    gl_Position = vec4(uv * 2.0 - 1.0, 0.0, 1.0);
}