Commit ff249ce4 authored by Kyle Russell's avatar Kyle Russell
Browse files

glamor: use glEGLImageTargetTexture2DOES during copy to update image texture

Texture sampling buffers may not be accepted in the same format as an image's
generated renderbuffer, so glamor should explicitly refresh the texture's
base image during the copy from the GL client to its X window.

This fix specifically addresses the most common PresentPixmap operations, and
does not attempt to support other DRI3 pixmap drawing operations.

Fixes: mesa/mesa#6220

Signed-off-by: Kyle Russell's avatarKyle Russell <>
parent 7b7170ec
Pipeline #582212 passed with stages
in 2 minutes and 23 seconds
......@@ -30,6 +30,7 @@ struct copy_args {
glamor_pixmap_fbo *src;
uint32_t bitplane;
int dx, dy;
EGLImageKHR image;
static Bool
......@@ -37,10 +38,14 @@ use_copyarea(PixmapPtr dst, GCPtr gc, glamor_program *prog, void *arg)
struct copy_args *args = arg;
glamor_pixmap_fbo *src = args->src;
EGLImageKHR image = args->image;
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image);
glUniform2f(prog->fill_offset_uniform, args->dx, args->dy);
glUniform2f(prog->fill_size_inv_uniform, 1.0f/src->width, 1.0f/src->height);
......@@ -452,6 +457,7 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src,
args.dx = dx + src_off_x - src_box->x1;
args.dy = dy + src_off_y - src_box->y1;
args.src = glamor_pixmap_fbo_at(src_priv, src_box_index);
args.image = src_priv->image;
if (!glamor_use_program(dst_pixmap, gc, prog, &args))
goto bail_ctx;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment