Render DRM-PRIME frames as opaque images
We can't always assume they are NV12. Even if they _are_ NV12, they may have DRM format modifiers that are incompatible with simply assuming linear Y and UV buffers (such as tiling).
This commit is contained in:
parent
a0b9684504
commit
26d04b5f9c
7 changed files with 140 additions and 48 deletions
12
app/shaders/egl_opaque.frag
Normal file
12
app/shaders/egl_opaque.frag
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#version 300 es
|
||||
#extension GL_OES_EGL_image_external : require
|
||||
precision mediump float;
|
||||
out vec4 FragColor;
|
||||
|
||||
in vec2 vTextCoord;
|
||||
|
||||
uniform samplerExternalOES uTexture;
|
||||
|
||||
void main() {
|
||||
FragColor = texture2D(uTexture, vTextCoord);
|
||||
}
|
||||
10
app/shaders/egl_opaque.vert
Normal file
10
app/shaders/egl_opaque.vert
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#version 300 es
|
||||
|
||||
layout (location = 0) in vec2 aPosition; // 2D: X,Y
|
||||
layout (location = 1) in vec2 aTexCoord;
|
||||
out vec2 vTextCoord;
|
||||
|
||||
void main() {
|
||||
vTextCoord = aTexCoord;
|
||||
gl_Position = vec4(aPosition, 0, 1);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue