mesa: rework Driver.CopyImageSubData() and related code
authorBrian Paul <brianp@vmware.com>
Fri, 28 Aug 2015 06:42:00 +0000 (00:42 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 24 Sep 2015 13:52:42 +0000 (07:52 -0600)
commit200aee424790f3167fcb175f4798af27783fe364
tree91b4724c5503637359b8068f94d35cdbdabe00df
parentc8cb5ed93c8e7343390f188bbf1a8459380a5739
mesa: rework Driver.CopyImageSubData() and related code

Previously, core Mesa's _mesa_CopyImageSubData() created temporary textures
to wrap renderbuffer sources/destinations.  This caused a bit of a mess in
the Mesa/gallium state tracker because we had to basically undo that
wrapping.

Instead, change ctx->Driver.CopyImageSubData() to take both gl_renderbuffer
and gl_texture_image src/dst pointers (one being null, the other non-null)
so the driver can handle renderbuffer vs. texture as needed.

For the i965 driver, we basically moved the code that wrapped textures
around renderbuffers from copyimage.c down into the met and driver code.

The old code in copyimage.c also made some questionable calls to
_mesa_BindTexture(), etc. which weren't undone at the end.

v2 (Jason Ekstrand): Rework the intel bits
v3 (Brian Paul): Update the temporary st_CopyImageSubData() function.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Tested-by: Nick Sarnie <commendsarnex@gmail.com>
src/mesa/drivers/common/meta.h
src/mesa/drivers/common/meta_copy_image.c
src/mesa/drivers/dri/i965/intel_copy_image.c
src/mesa/main/copyimage.c
src/mesa/main/dd.h
src/mesa/state_tracker/st_cb_texture.c