From 2d01663b2559c6d6a121c18b9496248dce8ad1a2 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Mon, 19 Mar 2018 15:45:34 +0100 Subject: gles2: Honor alpha in fragment_src_external By using the same vertex shader and adding alpha to the fragment shader for external textures we can: - use alpha blending - have wlr_gles2_render_texture_with_matrix work with the GL_TEXTURE_EXTERNAL_OES. So far this failed since we passed in alpha which was unknown by fragment_src_external --- render/gles2/shaders.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'render/gles2/shaders.c') diff --git a/render/gles2/shaders.c b/render/gles2/shaders.c index 2e9386d0..30e12e4c 100644 --- a/render/gles2/shaders.c +++ b/render/gles2/shaders.c @@ -80,8 +80,9 @@ const GLchar fragment_src_external[] = "precision mediump float;" "varying vec2 v_texcoord;" "uniform samplerExternalOES texture0;" +"uniform float alpha;" "" "void main() {" " vec4 col = texture2D(texture0, v_texcoord);" -" gl_FragColor = vec4(col.rgb, col.a);" +" gl_FragColor = vec4(col.rgb, col.a * alpha);" "}"; -- cgit v1.2.3