aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/dd.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-08-28 00:42:00 -0600
committerBrian Paul <[email protected]>2015-09-24 07:52:42 -0600
commit200aee424790f3167fcb175f4798af27783fe364 (patch)
tree91b4724c5503637359b8068f94d35cdbdabe00df /src/mesa/main/dd.h
parentc8cb5ed93c8e7343390f188bbf1a8459380a5739 (diff)
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 <[email protected]> Tested-by: Kai Wasserbäch <[email protected]> Tested-by: Nick Sarnie <[email protected]>
Diffstat (limited to 'src/mesa/main/dd.h')
-rw-r--r--src/mesa/main/dd.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 87eb63ea374..2c746fc45de 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -269,20 +269,25 @@ struct dd_function_table {
struct gl_renderbuffer *rb,
GLint x, GLint y,
GLsizei width, GLsizei height);
-
/**
* Called by glCopyImageSubData().
*
- * This function should copy one 2-D slice from srcTexImage to
- * dstTexImage. If one of the textures is 3-D or is a 1-D or 2-D array
+ * This function should copy one 2-D slice from src_teximage or
+ * src_renderbuffer to dst_teximage or dst_renderbuffer. Either the
+ * teximage or renderbuffer pointer will be non-null to indicate which
+ * is the real src/dst.
+ *
+ * If one of the textures is 3-D or is a 1-D or 2-D array
* texture, this function will be called multiple times: once for each
* slice. If one of the textures is a cube map, this function will be
* called once for each face to be copied.
*/
void (*CopyImageSubData)(struct gl_context *ctx,
- struct gl_texture_image *src_image,
+ struct gl_texture_image *src_teximage,
+ struct gl_renderbuffer *src_renderbuffer,
int src_x, int src_y, int src_z,
- struct gl_texture_image *dstTexImage,
+ struct gl_texture_image *dst_teximage,
+ struct gl_renderbuffer *dst_renderbuffer,
int dst_x, int dst_y, int dst_z,
int src_width, int src_height);