diff options
author | Brian Paul <[email protected]> | 2011-12-30 08:24:55 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-12-30 08:24:55 -0700 |
commit | da0cc82a093eb97212e989648da638a262ed3e84 (patch) | |
tree | d3271c7872ac0f6e5e882859d561584f80a4393c /src/mesa/main | |
parent | c22a95c4f2db64c61cb25f37acc38254f30850f1 (diff) |
mesa: simplify Driver.TexSubImage() parameters
There's no need to pass the target, level and texObj parameters since
they can be easily obtained from the texImage pointer.
Reviewed-by: Chad Versace <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/dd.h | 44 | ||||
-rw-r--r-- | src/mesa/main/mipmap.c | 5 | ||||
-rw-r--r-- | src/mesa/main/teximage.c | 15 | ||||
-rw-r--r-- | src/mesa/main/texstore.c | 21 | ||||
-rw-r--r-- | src/mesa/main/texstore.h | 21 |
5 files changed, 47 insertions, 59 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 5816faa783f..5226a6811cf 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -245,41 +245,39 @@ struct dd_function_table { * with new texel data. * \sa dd_function_table::TexImage1D. */ - void (*TexSubImage1D)( struct gl_context *ctx, GLenum target, GLint level, - GLint xoffset, GLsizei width, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ); + void (*TexSubImage1D)(struct gl_context *ctx, + struct gl_texture_image *texImage, + GLint xoffset, GLsizei width, + GLenum format, GLenum type, + const GLvoid *pixels, + const struct gl_pixelstore_attrib *packing); /** * Called by glTexSubImage2D(). * * \sa dd_function_table::TexSubImage1D. */ - void (*TexSubImage2D)( struct gl_context *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ); + void (*TexSubImage2D)(struct gl_context *ctx, + struct gl_texture_image *texImage, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels, + const struct gl_pixelstore_attrib *packing); /** * Called by glTexSubImage3D(). * * \sa dd_function_table::TexSubImage1D. */ - void (*TexSubImage3D)( struct gl_context *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, GLint depth, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ); + void (*TexSubImage3D)(struct gl_context *ctx, + struct gl_texture_image *texImage, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLint depth, + GLenum format, GLenum type, + const GLvoid *pixels, + const struct gl_pixelstore_attrib *packing); + /** * Called by glGetTexImage(). diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 867cb22e28a..9a6c6dea272 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -2132,11 +2132,10 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target, } /* The image space was allocated above so use glTexSubImage now */ - ctx->Driver.TexSubImage2D(ctx, target, level + 1, + ctx->Driver.TexSubImage2D(ctx, dstImage, 0, 0, dstWidth, dstHeight, temp_base_format, temp_datatype, - temp_dst, &ctx->DefaultPacking, - texObj, dstImage); + temp_dst, &ctx->DefaultPacking); /* swap src and dest pointers */ { diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 18a7b87c0d3..ad7a1ea0c8d 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2681,23 +2681,20 @@ texsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level, switch (dims) { case 1: - ctx->Driver.TexSubImage1D(ctx, target, level, + ctx->Driver.TexSubImage1D(ctx, texImage, xoffset, width, - format, type, pixels, - &ctx->Unpack, texObj, texImage ); + format, type, pixels, &ctx->Unpack); break; case 2: - ctx->Driver.TexSubImage2D(ctx, target, level, + ctx->Driver.TexSubImage2D(ctx, texImage, xoffset, yoffset, width, height, - format, type, pixels, - &ctx->Unpack, texObj, texImage ); + format, type, pixels, &ctx->Unpack); break; case 3: - ctx->Driver.TexSubImage3D(ctx, target, level, + ctx->Driver.TexSubImage3D(ctx, texImage, xoffset, yoffset, zoffset, width, height, depth, - format, type, pixels, - &ctx->Unpack, texObj, texImage ); + format, type, pixels, &ctx->Unpack); break; default: _mesa_problem(ctx, "unexpected dims in subteximage()"); diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 86c35d38f74..e97178dc8b5 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -4785,12 +4785,11 @@ _mesa_store_teximage3d(struct gl_context *ctx, GLenum target, GLint level, * This is the fallback for Driver.TexSubImage1D(). */ void -_mesa_store_texsubimage1d(struct gl_context *ctx, GLenum target, GLint level, +_mesa_store_texsubimage1d(struct gl_context *ctx, + struct gl_texture_image *texImage, GLint xoffset, GLint width, GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) + const struct gl_pixelstore_attrib *packing) { store_texsubimage(ctx, texImage, xoffset, 0, 0, width, 1, 1, @@ -4803,13 +4802,12 @@ _mesa_store_texsubimage1d(struct gl_context *ctx, GLenum target, GLint level, * This is the fallback for Driver.TexSubImage2D(). */ void -_mesa_store_texsubimage2d(struct gl_context *ctx, GLenum target, GLint level, +_mesa_store_texsubimage2d(struct gl_context *ctx, + struct gl_texture_image *texImage, GLint xoffset, GLint yoffset, GLint width, GLint height, GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) + const struct gl_pixelstore_attrib *packing) { store_texsubimage(ctx, texImage, xoffset, yoffset, 0, width, height, 1, @@ -4821,13 +4819,12 @@ _mesa_store_texsubimage2d(struct gl_context *ctx, GLenum target, GLint level, * This is the fallback for Driver.TexSubImage3D(). */ void -_mesa_store_texsubimage3d(struct gl_context *ctx, GLenum target, GLint level, +_mesa_store_texsubimage3d(struct gl_context *ctx, + struct gl_texture_image *texImage, GLint xoffset, GLint yoffset, GLint zoffset, GLint width, GLint height, GLint depth, GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) + const struct gl_pixelstore_attrib *packing) { store_texsubimage(ctx, texImage, xoffset, yoffset, zoffset, width, height, depth, diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index f956b0436b9..83826ce97e0 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -121,32 +121,29 @@ _mesa_store_teximage3d(struct gl_context *ctx, GLenum target, GLint level, extern void -_mesa_store_texsubimage1d(struct gl_context *ctx, GLenum target, GLint level, +_mesa_store_texsubimage1d(struct gl_context *ctx, + struct gl_texture_image *texImage, GLint xoffset, GLint width, GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); + const struct gl_pixelstore_attrib *packing); extern void -_mesa_store_texsubimage2d(struct gl_context *ctx, GLenum target, GLint level, +_mesa_store_texsubimage2d(struct gl_context *ctx, + struct gl_texture_image *texImage, GLint xoffset, GLint yoffset, GLint width, GLint height, GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); + const struct gl_pixelstore_attrib *packing); extern void -_mesa_store_texsubimage3d(struct gl_context *ctx, GLenum target, GLint level, +_mesa_store_texsubimage3d(struct gl_context *ctx, + struct gl_texture_image *texImage, GLint xoffset, GLint yoffset, GLint zoffset, GLint width, GLint height, GLint depth, GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); + const struct gl_pixelstore_attrib *packing); extern void |