summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-12-29 06:36:55 -0700
committerBrian Paul <[email protected]>2012-01-07 15:04:23 -0700
commit56b57aa360a8bad0c4b68fbdf7c64ac33f9e7661 (patch)
treea448d03e61122b0c68aaac023a3004f1144e1b8f /src/mesa/state_tracker
parent4c0f1fb5ec6117f07c9c911d7f74ff0d18c51d98 (diff)
mesa: rework ctx->Driver.CopyTexSubImage() parameters
Replace target, level parameters with gl_texture_image. Add gl_renderbuffer parameter to indicate source buffer for the copy. This removes some redundant code in the drivers to find the source renderbuffer and the destination texture image (which we already had in _mesa_CopyTexSubImage). Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 592d04b929f..ad4f23c7eb8 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -736,7 +736,7 @@ st_GetTexImage(struct gl_context * ctx,
* Note: srcY=0=TOP of renderbuffer
*/
static void
-fallback_copy_texsubimage(struct gl_context *ctx, GLenum target, GLint level,
+fallback_copy_texsubimage(struct gl_context *ctx,
struct st_renderbuffer *strb,
struct st_texture_image *stImage,
GLenum baseFormat,
@@ -931,17 +931,12 @@ compatible_src_dst_formats(struct gl_context *ctx,
*/
static void
st_copy_texsubimage(struct gl_context *ctx,
- GLenum target, GLint level,
+ struct gl_texture_image *texImage,
GLint destX, GLint destY, GLint destZ,
+ struct gl_renderbuffer *rb,
GLint srcX, GLint srcY,
GLsizei width, GLsizei height)
{
- struct gl_texture_unit *texUnit =
- &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- struct gl_texture_object *texObj =
- _mesa_select_tex_object(ctx, texUnit, target);
- struct gl_texture_image *texImage =
- _mesa_select_tex_image(ctx, texObj, target, level);
struct st_texture_image *stImage = st_texture_image(texImage);
const GLenum texBaseFormat = texImage->_BaseFormat;
struct gl_framebuffer *fb = ctx->ReadBuffer;
@@ -1096,7 +1091,7 @@ st_copy_texsubimage(struct gl_context *ctx,
fallback:
/* software fallback */
- fallback_copy_texsubimage(ctx, target, level,
+ fallback_copy_texsubimage(ctx,
strb, stImage, texBaseFormat,
destX, destY, destZ,
srcX, srcY, width, height);
@@ -1105,37 +1100,44 @@ fallback:
static void
-st_CopyTexSubImage1D(struct gl_context * ctx, GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width)
+st_CopyTexSubImage1D(struct gl_context *ctx,
+ struct gl_texture_image *texImage,
+ GLint xoffset,
+ struct gl_renderbuffer *rb,
+ GLint x, GLint y, GLsizei width)
{
const GLint yoffset = 0, zoffset = 0;
const GLsizei height = 1;
- st_copy_texsubimage(ctx, target, level,
+ st_copy_texsubimage(ctx, texImage,
xoffset, yoffset, zoffset, /* destX,Y,Z */
- x, y, width, height); /* src X, Y, size */
+ rb, x, y, width, height); /* src X, Y, size */
}
static void
-st_CopyTexSubImage2D(struct gl_context * ctx, GLenum target, GLint level,
+st_CopyTexSubImage2D(struct gl_context *ctx,
+ struct gl_texture_image *texImage,
GLint xoffset, GLint yoffset,
+ struct gl_renderbuffer *rb,
GLint x, GLint y, GLsizei width, GLsizei height)
{
const GLint zoffset = 0;
- st_copy_texsubimage(ctx, target, level,
+ st_copy_texsubimage(ctx, texImage,
xoffset, yoffset, zoffset, /* destX,Y,Z */
- x, y, width, height); /* src X, Y, size */
+ rb, x, y, width, height); /* src X, Y, size */
}
static void
-st_CopyTexSubImage3D(struct gl_context * ctx, GLenum target, GLint level,
+st_CopyTexSubImage3D(struct gl_context *ctx,
+ struct gl_texture_image *texImage,
GLint xoffset, GLint yoffset, GLint zoffset,
+ struct gl_renderbuffer *rb,
GLint x, GLint y, GLsizei width, GLsizei height)
{
- st_copy_texsubimage(ctx, target, level,
+ st_copy_texsubimage(ctx, texImage,
xoffset, yoffset, zoffset, /* destX,Y,Z */
- x, y, width, height); /* src X, Y, size */
+ rb, x, y, width, height); /* src X, Y, size */
}