From c5af8891805fc4f590c1371c098cdbc704c44e00 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Tue, 12 Jun 2012 21:38:43 +0300 Subject: mesa: Remove unnecessary parameters from TexImage gl_texture_image structure always holds size and internal format before TexImage driver hook is called. Those passing same information in function parameters only duplicates information making the interface harder to understand. Signed-off-by: Pauli Nieminen Reviewed-by: Brian Paul Reviewed-by: Kenneth Graunke --- src/mesa/state_tracker/st_cb_texture.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 92ce3fa2073..0c4e8a8f47b 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -500,8 +500,6 @@ st_AllocTextureImageBuffer(struct gl_context *ctx, */ static void prep_teximage(struct gl_context *ctx, struct gl_texture_image *texImage, - GLint internalFormat, - GLint width, GLint height, GLint depth, GLint border, GLenum format, GLenum type) { struct gl_texture_object *texObj = texImage->TexObject; @@ -518,11 +516,13 @@ prep_teximage(struct gl_context *ctx, struct gl_texture_image *texImage, /* oops, need to init this image again */ texFormat = _mesa_choose_texture_format(ctx, texObj, target, level, - internalFormat, format, type); + texImage->InternalFormat, format, + type); _mesa_init_teximage_fields(ctx, texImage, - width, height, depth, border, - internalFormat, texFormat); + texImage->Width, texImage->Height, + texImage->Depth, texImage->Border, + texImage->InternalFormat, texFormat); stObj->surface_based = GL_FALSE; } @@ -532,15 +532,11 @@ prep_teximage(struct gl_context *ctx, struct gl_texture_image *texImage, static void st_TexImage(struct gl_context * ctx, GLuint dims, struct gl_texture_image *texImage, - GLint internalFormat, - GLint width, GLint height, GLint depth, GLint border, GLenum format, GLenum type, const void *pixels, const struct gl_pixelstore_attrib *unpack) { - prep_teximage(ctx, texImage, internalFormat, width, height, depth, border, - format, type); - _mesa_store_teximage(ctx, dims, texImage, internalFormat, width, height, depth, - border, format, type, pixels, unpack); + prep_teximage(ctx, texImage, format, type); + _mesa_store_teximage(ctx, dims, texImage, format, type, pixels, unpack); } @@ -551,8 +547,7 @@ st_CompressedTexImage(struct gl_context *ctx, GLuint dims, GLint width, GLint height, GLint border, GLint depth, GLsizei imageSize, const GLvoid *data) { - prep_teximage(ctx, texImage, internalFormat, width, height, depth, border, - GL_NONE, GL_NONE); + prep_teximage(ctx, texImage, GL_NONE, GL_NONE); _mesa_store_compressed_teximage(ctx, dims, texImage, internalFormat, width, height, depth, border, imageSize, data); } -- cgit v1.2.3