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 | 92c64624cd7533cde466dbec8722f7f72f275fd8 (patch) | |
tree | cac6f3e610b12f407a088f81c5c10896b1343458 /src/mesa/state_tracker | |
parent | da0cc82a093eb97212e989648da638a262ed3e84 (diff) |
mesa: simplify Driver.TexImage() parameters
As with TexSubImage(), the target, level and texObj values can be obtained
through the texImage pointer.
Reviewed-by: Chad Versace <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 8d30d7acb54..8597dff0789 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -501,19 +501,20 @@ st_AllocTextureImageBuffer(struct gl_context *ctx, static void st_TexImage(struct gl_context * ctx, GLint dims, - GLenum target, GLint level, + 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, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage, GLsizei imageSize, GLboolean compressed_src) { struct st_context *st = st_context(ctx); + struct gl_texture_object *texObj = texImage->TexObject; struct st_texture_object *stObj = st_texture_object(texObj); struct st_texture_image *stImage = st_texture_image(texImage); + const GLenum target = texObj->Target; + const GLuint level = texImage->Level; GLuint dstRowStride = 0; enum pipe_transfer_usage transfer_usage = 0; GLubyte *dstMap; @@ -736,48 +737,41 @@ done: static void st_TexImage3D(struct gl_context * ctx, - GLenum target, GLint level, + 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, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) + const struct gl_pixelstore_attrib *unpack) { - st_TexImage(ctx, 3, target, level, internalFormat, width, height, depth, - border, format, type, pixels, unpack, texObj, texImage, - 0, GL_FALSE); + st_TexImage(ctx, 3, texImage, internalFormat, width, height, depth, border, + format, type, pixels, unpack, 0, GL_FALSE); } static void st_TexImage2D(struct gl_context * ctx, - GLenum target, GLint level, + struct gl_texture_image *texImage, GLint internalFormat, GLint width, GLint height, GLint border, GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *unpack, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) + const struct gl_pixelstore_attrib *unpack) { - st_TexImage(ctx, 2, target, level, internalFormat, width, height, 1, border, - format, type, pixels, unpack, texObj, texImage, 0, GL_FALSE); + st_TexImage(ctx, 2, texImage, internalFormat, width, height, 1, border, + format, type, pixels, unpack, 0, GL_FALSE); } static void st_TexImage1D(struct gl_context * ctx, - GLenum target, GLint level, + struct gl_texture_image *texImage, GLint internalFormat, GLint width, GLint border, GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *unpack, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) + const struct gl_pixelstore_attrib *unpack) { - st_TexImage(ctx, 1, target, level, internalFormat, width, 1, 1, border, - format, type, pixels, unpack, texObj, texImage, 0, GL_FALSE); + st_TexImage(ctx, 1, texImage, internalFormat, width, 1, 1, border, + format, type, pixels, unpack, 0, GL_FALSE); } @@ -789,8 +783,8 @@ st_CompressedTexImage2D(struct gl_context *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - st_TexImage(ctx, 2, target, level, internalFormat, width, height, 1, border, - 0, 0, data, &ctx->Unpack, texObj, texImage, imageSize, GL_TRUE); + st_TexImage(ctx, 2, texImage, internalFormat, width, height, 1, border, + 0, 0, data, &ctx->Unpack, imageSize, GL_TRUE); } @@ -1644,13 +1638,13 @@ st_get_default_texture(struct st_context *st) 16, 16, 1, 0, /* w, h, d, border */ GL_RGBA, MESA_FORMAT_RGBA8888); - st_TexImage(st->ctx, 2, target, - 0, GL_RGBA, /* level, intformat */ + st_TexImage(st->ctx, 2, + texImg, + GL_RGBA, /* level, intformat */ 16, 16, 1, 0, /* w, h, d, border */ GL_RGBA, GL_UNSIGNED_BYTE, pixels, &st->ctx->DefaultPacking, - texObj, texImg, - 0, 0); + 0, GL_FALSE); texObj->Sampler.MinFilter = GL_NEAREST; texObj->Sampler.MagFilter = GL_NEAREST; |