glamor: Don't optimize out scissor updates in CopyArea.

This possibly is a minor hit for immediate mode renderers (no
difference on copypixin100 on my hsw, n=12), but it gives important
information about drawing bounds to a deferred renderer (3.1x
improvement in copypixwin100 on vc4).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Eric Anholt 2014-12-28 19:39:45 -10:00
parent 6ba6cc57e1
commit 909a406aa2

View File

@ -315,7 +315,6 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src,
struct copy_args args;
glamor_program *prog;
const glamor_facet *copy_facet;
Bool set_scissor;
int n;
glamor_make_current(glamor_priv);
@ -367,9 +366,7 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src,
glamor_get_drawable_deltas(src, src_pixmap, &src_off_x, &src_off_y);
set_scissor = glamor_pixmap_priv_is_large(src_priv);
if (set_scissor)
glEnable(GL_SCISSOR_TEST);
glEnable(GL_SCISSOR_TEST);
glamor_pixmap_loop(src_priv, src_box_x, src_box_y) {
BoxPtr src_box = glamor_pixmap_box_at(src_priv, src_box_x, src_box_y);
@ -385,11 +382,10 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src,
glamor_set_destination_drawable(dst, dst_box_x, dst_box_y, FALSE, FALSE,
prog->matrix_uniform, &dst_off_x, &dst_off_y);
if (set_scissor)
glScissor(dst_off_x - args.dx,
dst_off_y - args.dy,
src_box->x2 - src_box->x1,
src_box->y2 - src_box->y1);
glScissor(dst_off_x - args.dx,
dst_off_y - args.dy,
src_box->x2 - src_box->x1,
src_box->y2 - src_box->y1);
if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP)
glDrawArrays(GL_QUADS, 0, nbox * 4);
@ -400,8 +396,7 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src,
}
}
}
if (set_scissor)
glDisable(GL_SCISSOR_TEST);
glDisable(GL_SCISSOR_TEST);
glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
return TRUE;